org.jboss.jca.common.metadata
Class AbstractParser

java.lang.Object
  extended by org.jboss.jca.common.metadata.AbstractParser
Direct Known Subclasses:
CommonIronJacamarParser, DsParser, RaParser

public abstract class AbstractParser
extends Object

A AbstractParser.

Author:
Stefano Maestri

Constructor Summary
AbstractParser()
           
 
Method Summary
protected  boolean attributeAsBoolean(XMLStreamReader reader, String attributeName, boolean defaultValue)
          convert an xml attribute in boolean value.
protected  String attributeAsString(XMLStreamReader reader, String attributeName)
          convert an xml element in String value
protected  boolean elementAsBoolean(XMLStreamReader reader)
          convert an xml element in boolean value.
protected  Integer elementAsInteger(XMLStreamReader reader)
          convert an xml element in Integer value
protected  Long elementAsLong(XMLStreamReader reader)
          convert an xml element in Long value
protected  String elementAsString(XMLStreamReader reader)
          convert an xml element in String value
protected  org.jboss.jca.common.api.metadata.common.CommonPool parsePool(XMLStreamReader reader)
          parse a CommonPool object
protected  org.jboss.jca.common.api.metadata.common.CommonSecurity parseSecuritySettings(XMLStreamReader reader)
          parse a CommonSecurity element
protected  org.jboss.jca.common.api.metadata.common.CommonXaPool parseXaPool(XMLStreamReader reader)
          parse a CommonXaPool object
 
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 boolean elementAsBoolean(XMLStreamReader reader)
                            throws XMLStreamException
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 exception

attributeAsBoolean

protected boolean attributeAsBoolean(XMLStreamReader reader,
                                     String attributeName,
                                     boolean defaultValue)
                              throws XMLStreamException
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:
XMLStreamException - StAX exception

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 reader
attributeName - 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 exception
ParserException - 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 exception
ParserException - in case it isn't a number

parsePool

protected org.jboss.jca.common.api.metadata.common.CommonPool parsePool(XMLStreamReader reader)
                                                                 throws XMLStreamException,
                                                                        ParserException
parse a CommonPool object

Parameters:
reader - reader
Returns:
the parsed CommonPool object
Throws:
XMLStreamException - XMLStreamException
ParserException - ParserException

parseSecuritySettings

protected org.jboss.jca.common.api.metadata.common.CommonSecurity parseSecuritySettings(XMLStreamReader reader)
                                                                                 throws XMLStreamException,
                                                                                        ParserException
parse a CommonSecurity element

Parameters:
reader - reader
Returns:
a CommonSecurity object
Throws:
XMLStreamException - XMLStreamException
ParserException - ParserException

parseXaPool

protected org.jboss.jca.common.api.metadata.common.CommonXaPool parseXaPool(XMLStreamReader reader)
                                                                     throws XMLStreamException,
                                                                            ParserException
parse a CommonXaPool object

Parameters:
reader - reader
Returns:
the parsed CommonXaPool object
Throws:
XMLStreamException - XMLStreamException
ParserException - ParserException


Copyright © 2008 Red Hat Middleware LLC (http://www.jboss.com/)