Package org.jboss.jca.as.converters
Class AbstractParser
java.lang.Object
org.jboss.jca.as.converters.AbstractParser
- Direct Known Subclasses:
LegacyCfParser,LegacyDsParser
A AbstractParser.
- Author:
- Stefano Maestri, Jeff Zhang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 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 valueprotected StringelementAsStringNoNest(XMLStreamReader reader) convert an xml element in String value but ignore nest element
-
Constructor Details
-
AbstractParser
public AbstractParser()
-
-
Method Details
-
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
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
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
-
elementAsStringNoNest
convert an xml element in String value but ignore nest element- Parameters:
reader- the StAX reader- Returns:
- the string representing element
- Throws:
XMLStreamException- StAX exception
-