org.jboss.jca.as.converters

## Class AbstractParser

- java.lang.Object
- - org.jboss.jca.as.converters.AbstractParser

- Direct Known Subclasses:
    LegacyCfParser, LegacyDsParser

      public abstract class AbstractParser
      extends java.lang.Object

  A AbstractParser.
  Author:
    Stefano Maestri, Jeff Zhang

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractParser()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.Boolean` | `attributeAsBoolean(javax.xml.stream.XMLStreamReader reader, java.lang.String attributeName, java.lang.Boolean defaultValue)` convert an xml attribute in boolean value.
    `protected java.lang.Integer` | `attributeAsInt(javax.xml.stream.XMLStreamReader reader, java.lang.String attributeName)` convert an xml element in String value
    `protected java.lang.String` | `attributeAsString(javax.xml.stream.XMLStreamReader reader, java.lang.String attributeName)` convert an xml element in String value
    `protected java.lang.Boolean` | `elementAsBoolean(javax.xml.stream.XMLStreamReader reader)` convert an xml element in boolean value.
    `protected java.lang.Integer` | `elementAsInteger(javax.xml.stream.XMLStreamReader reader)` convert an xml element in Integer value
    `protected java.lang.Long` | `elementAsLong(javax.xml.stream.XMLStreamReader reader)` convert an xml element in Long value
    `protected java.lang.String` | `elementAsString(javax.xml.stream.XMLStreamReader reader)` convert an xml element in String value
    `protected java.lang.String` | `elementAsStringNoNest(javax.xml.stream.XMLStreamReader reader)` convert an xml element in String value but ignore nest element

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractParser

          public AbstractParser()

  - ### Method Detail

    - #### elementAsBoolean

          protected java.lang.Boolean elementAsBoolean(javax.xml.stream.XMLStreamReader reader)
                                                throws javax.xml.stream.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:
        `javax.xml.stream.XMLStreamException` - StAX exception
        `ParserException` - in case of non valid boolean for given element value

    - #### attributeAsBoolean

          protected java.lang.Boolean attributeAsBoolean(javax.xml.stream.XMLStreamReader reader,
                                                         java.lang.String attributeName,
                                                         java.lang.Boolean defaultValue)
                                                  throws javax.xml.stream.XMLStreamException,
                                                         ParserException

      convert an xml attribute in boolean value. Empty elements results with false
      Parameters:
        `reader` - the StAX reader
        `attributeName` - the name of the attribute
        `defaultValue` - defaultValue
      Returns:
        the boolean representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception
        `ParserException` - in case of not valid boolena for given attribute

    - #### elementAsString

          protected java.lang.String elementAsString(javax.xml.stream.XMLStreamReader reader)
                                              throws javax.xml.stream.XMLStreamException

      convert an xml element in String value
      Parameters:
        `reader` - the StAX reader
      Returns:
        the string representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception

    - #### attributeAsString

          protected java.lang.String attributeAsString(javax.xml.stream.XMLStreamReader reader,
                                                       java.lang.String attributeName)
                                                throws javax.xml.stream.XMLStreamException

      convert an xml element in String value
      Parameters:
        `reader` - the StAX reader
        `attributeName` - the name of the attribute
      Returns:
        the string representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception

    - #### attributeAsInt

          protected java.lang.Integer attributeAsInt(javax.xml.stream.XMLStreamReader reader,
                                                     java.lang.String attributeName)
                                              throws javax.xml.stream.XMLStreamException

      convert an xml element in String value
      Parameters:
        `reader` - the StAX reader
        `attributeName` - the name of the attribute
      Returns:
        the string representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception

    - #### elementAsInteger

          protected java.lang.Integer elementAsInteger(javax.xml.stream.XMLStreamReader reader)
                                                throws javax.xml.stream.XMLStreamException,
                                                       ParserException

      convert an xml element in Integer value
      Parameters:
        `reader` - the StAX reader
      Returns:
        the integer representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception
        `ParserException` - in case it isn't a number

    - #### elementAsLong

          protected java.lang.Long elementAsLong(javax.xml.stream.XMLStreamReader reader)
                                          throws javax.xml.stream.XMLStreamException,
                                                 ParserException

      convert an xml element in Long value
      Parameters:
        `reader` - the StAX reader
      Returns:
        the long representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception
        `ParserException` - in case it isn't a number

    - #### elementAsStringNoNest

          protected java.lang.String elementAsStringNoNest(javax.xml.stream.XMLStreamReader reader)
                                                    throws javax.xml.stream.XMLStreamException

      convert an xml element in String value but ignore nest element
      Parameters:
        `reader` - the StAX reader
      Returns:
        the string representing element
      Throws:
        `javax.xml.stream.XMLStreamException` - StAX exception

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)