Class AbstractParser
- java.lang.Object
-
- org.jboss.jca.common.metadata.common.AbstractParser
-
- Direct Known Subclasses:
CommonIronJacamarParser,DsParser,RaParser
public abstract class AbstractParser extends Object
A AbstractParser.- Author:
- Stefano Maestri
-
-
Field Summary
Fields Modifier and Type Field Description protected static CommonBundlebundleThe bundleprotected static CommonLoggerlogThe logger
-
Constructor Summary
Constructors Constructor Description AbstractParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BooleanattributeAsBoolean(XMLStreamReader reader, String attributeName, Boolean defaultValue)convert an xml attribute in boolean value.protected IntegerattributeAsInt(XMLStreamReader reader, String attributeName)convert an xml element in String valueprotected StringattributeAsString(XMLStreamReader reader, String attributeName)convert an xml element in String valueprotected BooleanelementAsBoolean(XMLStreamReader reader)convert an xml element in boolean value.protected FlushStrategyelementAsFlushStrategy(XMLStreamReader reader)convert an xml element in FlushStrategy valueprotected IntegerelementAsInteger(XMLStreamReader reader)convert an xml element in Integer valueprotected LongelementAsLong(XMLStreamReader reader)convert an xml element in Long valueprotected StringelementAsString(XMLStreamReader reader)convert an xml element in String valuebooleanisSystemPropertiesResolved()protected CapacityparseCapacity(XMLStreamReader reader)Parse capacity tagprotected voidparseConfigProperty(Map<String,String> configProperties, XMLStreamReader reader)Adds config property to the mapprotected CredentialparseCredential(XMLStreamReader reader)parse credential tagprotected ExtensionparseExtension(XMLStreamReader reader, String enclosingTag)parse the Extension tagprotected PoolparsePool(XMLStreamReader reader)parse aPoolobjectprotected RecoveryparseRecovery(XMLStreamReader reader)Parse recovery tagprotected SecurityparseSecuritySettings(XMLStreamReader reader)parse aSecurityelementprotected TimeOutparseTimeOut(XMLStreamReader reader, Boolean isXa)Parse timeoutprotected ValidationparseValidation(XMLStreamReader reader)Parse validationprotected XaPoolparseXaPool(XMLStreamReader reader)parse aXaPoolobjectvoidsetSystemPropertiesResolved(boolean v)
-
-
-
Field Detail
-
log
protected static CommonLogger log
The logger
-
bundle
protected static CommonBundle bundle
The bundle
-
-
Method Detail
-
isSystemPropertiesResolved
public boolean isSystemPropertiesResolved()
-
setSystemPropertiesResolved
public void setSystemPropertiesResolved(boolean v)
-
elementAsBoolean
protected Boolean elementAsBoolean(XMLStreamReader reader) throws XMLStreamException, ParserException
convert an xml element in boolean value. Empty elements results with true (tag presence is sufficient condition)- Parameters:
reader- the StAX reader- Returns:
- the boolean representing element
- Throws:
XMLStreamException- StAX exceptionParserException- in case of non valid boolean for given element value
-
attributeAsBoolean
protected Boolean attributeAsBoolean(XMLStreamReader reader, String attributeName, Boolean defaultValue) throws XMLStreamException, ParserException
convert an xml attribute in boolean value. Empty elements results with false- Parameters:
reader- the StAX readerattributeName- the name of the attributedefaultValue- defaultValue- Returns:
- the boolean representing element
- Throws:
XMLStreamException- StAX exceptionParserException- in case of not valid boolena for given attribute
-
elementAsString
protected String elementAsString(XMLStreamReader reader) throws XMLStreamException
convert an xml element in String value- Parameters:
reader- the StAX reader- Returns:
- the string representing element
- Throws:
XMLStreamException- StAX exception
-
attributeAsString
protected String attributeAsString(XMLStreamReader reader, String attributeName) throws XMLStreamException
convert an xml element in String value- Parameters:
reader- the StAX readerattributeName- the name of the attribute- Returns:
- the string representing element
- Throws:
XMLStreamException- StAX exception
-
attributeAsInt
protected Integer attributeAsInt(XMLStreamReader reader, String attributeName) throws XMLStreamException
convert an xml element in String value- Parameters:
reader- the StAX readerattributeName- the name of the attribute- Returns:
- the string representing element
- Throws:
XMLStreamException- StAX exception
-
elementAsInteger
protected Integer elementAsInteger(XMLStreamReader reader) throws XMLStreamException, ParserException
convert an xml element in Integer value- Parameters:
reader- the StAX reader- Returns:
- the integer representing element
- Throws:
XMLStreamException- StAX exceptionParserException- in case it isn't a number
-
elementAsLong
protected Long elementAsLong(XMLStreamReader reader) throws XMLStreamException, ParserException
convert an xml element in Long value- Parameters:
reader- the StAX reader- Returns:
- the long representing element
- Throws:
XMLStreamException- StAX exceptionParserException- in case it isn't a number
-
elementAsFlushStrategy
protected FlushStrategy elementAsFlushStrategy(XMLStreamReader reader) throws XMLStreamException, ParserException
convert an xml element in FlushStrategy value- Parameters:
reader- the StAX reader- Returns:
- the flush strategy represention
- Throws:
XMLStreamException- StAX exceptionParserException- in case it isn't a number
-
parsePool
protected Pool parsePool(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
parse aPoolobject- Parameters:
reader- reader- Returns:
- the parsed
Poolobject - Throws:
XMLStreamException- XMLStreamExceptionParserException- ParserExceptionValidateException- ValidateException
-
parseXaPool
protected XaPool parseXaPool(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
parse aXaPoolobject- Parameters:
reader- reader- Returns:
- the parsed
XaPoolobject - Throws:
XMLStreamException- XMLStreamExceptionParserException- ParserExceptionValidateException- ValidateException
-
parseSecuritySettings
protected Security parseSecuritySettings(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
parse aSecurityelement- Parameters:
reader- reader- Returns:
- a
Securityobject - Throws:
XMLStreamException- XMLStreamExceptionParserException- ParserExceptionValidateException- ValidateException
-
parseCredential
protected Credential parseCredential(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
parse credential tag- Parameters:
reader- reader- Returns:
- the parse Object
- Throws:
XMLStreamException- in case of errorParserException- in case of errorValidateException- in case of error
-
parseRecovery
protected Recovery parseRecovery(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
Parse recovery tag- Parameters:
reader- reader- Returns:
- the parsed recovery object
- Throws:
XMLStreamException- in case of errorParserException- in case of errorValidateException- in case of error
-
parseExtension
protected Extension parseExtension(XMLStreamReader reader, String enclosingTag) throws XMLStreamException, ParserException, ValidateException
parse the Extension tag- Parameters:
reader- readerenclosingTag- enclosingTag- Returns:
- the parsed extension object
- Throws:
XMLStreamException- in case of errorParserException- in case of errorValidateException- in case of error
-
parseCapacity
protected Capacity parseCapacity(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
Parse capacity tag- Parameters:
reader- reader- Returns:
- the parsed recovery object
- Throws:
XMLStreamException- in case of errorParserException- in case of errorValidateException- in case of error
-
parseValidation
protected Validation parseValidation(XMLStreamReader reader) throws XMLStreamException, ParserException, ValidateException
Parse validation- Parameters:
reader- The reader- Returns:
- The result
- Throws:
XMLStreamException- XMLStreamExceptionParserException- ParserExceptionValidateException- ValidateException
-
parseTimeOut
protected TimeOut parseTimeOut(XMLStreamReader reader, Boolean isXa) throws XMLStreamException, ParserException, ValidateException
Parse timeout- Parameters:
reader- The readerisXa- XA flag- Returns:
- The result
- Throws:
XMLStreamException- XMLStreamExceptionParserException- ParserExceptionValidateException- ValidateException
-
parseConfigProperty
protected void parseConfigProperty(Map<String,String> configProperties, XMLStreamReader reader) throws XMLStreamException, ParserException
Adds config property to the map- Parameters:
configProperties- mapreader- XMLStream reader- Throws:
XMLStreamException- in case of errorParserException- in case of error
-
-