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  org.jboss.jca.common.api.metadata.common.FlushStrategy elementAsFlushStrategy(XMLStreamReader reader)
          convert an xml element in FlushStrategy 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.Credential parseCredential(XMLStreamReader reader)
          parse credential tag
protected  org.jboss.jca.common.api.metadata.common.Extension parseExtension(XMLStreamReader reader, String enclosingTag)
          parse the Extension tag
protected  org.jboss.jca.common.api.metadata.common.CommonPool parsePool(XMLStreamReader reader)
          parse a CommonPool object
protected  org.jboss.jca.common.api.metadata.common.Recovery parseRecovery(XMLStreamReader reader)
          Parse recovery tag
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,
                                   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 exception
ParserException - 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 reader
attributeName - the name of the attribute
defaultValue - defaultValue
Returns:
the boolean representing element
Throws:
XMLStreamException - StAX exception
ParserException - 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 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

elementAsFlushStrategy

protected org.jboss.jca.common.api.metadata.common.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 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,
                                                                        org.jboss.jca.common.api.validator.ValidateException
parse a CommonPool object

Parameters:
reader - reader
Returns:
the parsed CommonPool object
Throws:
XMLStreamException - XMLStreamException
ParserException - ParserException
org.jboss.jca.common.api.validator.ValidateException - ValidateException

parseSecuritySettings

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

Parameters:
reader - reader
Returns:
a CommonSecurity object
Throws:
XMLStreamException - XMLStreamException
ParserException - ParserException
org.jboss.jca.common.api.validator.ValidateException - ValidateException

parseXaPool

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

Parameters:
reader - reader
Returns:
the parsed CommonXaPool object
Throws:
XMLStreamException - XMLStreamException
ParserException - ParserException
org.jboss.jca.common.api.validator.ValidateException - ValidateException

parseCredential

protected org.jboss.jca.common.api.metadata.common.Credential parseCredential(XMLStreamReader reader)
                                                                       throws XMLStreamException,
                                                                              ParserException,
                                                                              org.jboss.jca.common.api.validator.ValidateException
parse credential tag

Parameters:
reader - reader
Returns:
the parse Object
Throws:
XMLStreamException - in case of error
ParserException - in case of error
org.jboss.jca.common.api.validator.ValidateException - in case of error

parseRecovery

protected org.jboss.jca.common.api.metadata.common.Recovery parseRecovery(XMLStreamReader reader)
                                                                   throws XMLStreamException,
                                                                          ParserException,
                                                                          org.jboss.jca.common.api.validator.ValidateException
Parse recovery tag

Parameters:
reader - reader
Returns:
the parsed recovery object
Throws:
XMLStreamException - in case of error
ParserException - in case of error
org.jboss.jca.common.api.validator.ValidateException - in case of error

parseExtension

protected org.jboss.jca.common.api.metadata.common.Extension parseExtension(XMLStreamReader reader,
                                                                            String enclosingTag)
                                                                     throws XMLStreamException,
                                                                            ParserException,
                                                                            org.jboss.jca.common.api.validator.ValidateException
parse the Extension tag

Parameters:
reader - reader
enclosingTag - enclosingTag
Returns:
the parsed extension object
Throws:
XMLStreamException - in case of error
ParserException - in case of error
org.jboss.jca.common.api.validator.ValidateException - in case of error


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