|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.webmancer.util.xml.sax.ContentHandlerUtils
public class ContentHandlerUtils
This class provides various utility methods used while creating SAX parsers. SAX parsing is parsing of XML files using Simple API for XML.
Method Summary | |
---|---|
static void |
expected(boolean condition,
java.lang.String message,
org.xml.sax.Locator locator)
Throws SAXSemanticException if the given condition is not satisfied. |
static java.lang.String |
getAttributesValue(org.xml.sax.Attributes atts,
javax.xml.namespace.QName attributeQName)
Search in atts for an attribute with name given by attributeQName and return its
value or null if no such attribute is found. |
static double |
getAttributesValueAsDouble(org.xml.sax.Attributes atts,
javax.xml.namespace.QName attributeQName,
org.xml.sax.Locator locator)
Search in atts for an attribute with name given by attributeQName and return its
value as double. |
static float |
getAttributesValueAsFloat(org.xml.sax.Attributes atts,
javax.xml.namespace.QName attributeQName,
org.xml.sax.Locator locator)
Search in atts for an attribute with name given by attributeQName and return its
value as float. |
static int |
getAttributesValueAsInt(org.xml.sax.Attributes atts,
javax.xml.namespace.QName attributeQName,
org.xml.sax.Locator locator)
Search in atts for an attribute with name given by attributeQName and return its
value as int. |
static long |
getAttributesValueAsLong(org.xml.sax.Attributes atts,
javax.xml.namespace.QName attributeQName,
org.xml.sax.Locator locator)
Search in atts for an attribute with name given by attributeQName and return its
value as long. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getAttributesValue(org.xml.sax.Attributes atts, javax.xml.namespace.QName attributeQName)
atts
for an attribute with name given by attributeQName
and return its
value or null
if no such attribute is found. All parameters must not be null
.
atts
- The list of attributes being searched inattributeQName
- The QName of the searched attribute
null
if no such attribute is foundpublic static void expected(boolean condition, java.lang.String message, org.xml.sax.Locator locator) throws SAXSemanticException
SAXSemanticException
if the given condition
is not satisfied.
condition
- The condition that has to be satisfied or the exception is thrownmessage
- The error messagelocator
- The locator of the error
SAXSemanticException
- Thrown if the given condition is not satisfiedpublic static int getAttributesValueAsInt(org.xml.sax.Attributes atts, javax.xml.namespace.QName attributeQName, org.xml.sax.Locator locator) throws SAXSemanticException
atts
for an attribute with name given by attributeQName
and return its
value as int. If no such attribute is found or its value is not parsable string, the SAXSemanticException
is thrown.
atts
- The list of attributes being searched inattributeQName
- The QName of the searched attributelocator
- The locator that would be used in exception creation
SAXSemanticException
- Thrown if no such attribute is found or its value is not parsable stringpublic static long getAttributesValueAsLong(org.xml.sax.Attributes atts, javax.xml.namespace.QName attributeQName, org.xml.sax.Locator locator) throws SAXSemanticException
atts
for an attribute with name given by attributeQName
and return its
value as long. If no such attribute is found or its value is not parsable string, the
SAXSemanticException
is thrown.
atts
- The list of attributes being searched inattributeQName
- The QName of the searched attributelocator
- The locator that would be used in exception creation
SAXSemanticException
- Thrown if no such attribute is found or its value is not parsable stringpublic static float getAttributesValueAsFloat(org.xml.sax.Attributes atts, javax.xml.namespace.QName attributeQName, org.xml.sax.Locator locator) throws SAXSemanticException
atts
for an attribute with name given by attributeQName
and return its
value as float. If no such attribute is found or its value is not parsable string, the
SAXSemanticException
is thrown.
atts
- The list of attributes being searched inattributeQName
- The QName of the searched attributelocator
- The locator that would be used in exception creation
SAXSemanticException
- Thrown if no such attribute is found or its value is not parsable stringpublic static double getAttributesValueAsDouble(org.xml.sax.Attributes atts, javax.xml.namespace.QName attributeQName, org.xml.sax.Locator locator) throws SAXSemanticException
atts
for an attribute with name given by attributeQName
and return its
value as double. If no such attribute is found or its value is not parsable string, the
SAXSemanticException
is thrown.
atts
- The list of attributes being searched inattributeQName
- The QName of the searched attributelocator
- The locator that would be used in exception creation
SAXSemanticException
- Thrown if no such attribute is found or its value is not parsable string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |