org.apache.torque.generator.configuration
Class SaxHelper

java.lang.Object
  extended by org.apache.torque.generator.configuration.SaxHelper

public final class SaxHelper
extends Object

Helper methods for SAX handlers.


Method Summary
static Boolean getBooleanAttribute(String attributeName, Attributes attributes, String elementDescription)
          Retrieves an attribute as boolean value.
static String getUnqualifiedName(String localName, String qName)
          Retrieves the unqualified part of an XML element name name, regardless whether namespace processing is switched on or off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBooleanAttribute

public static Boolean getBooleanAttribute(String attributeName,
                                          Attributes attributes,
                                          String elementDescription)
                                   throws SAXException
Retrieves an attribute as boolean value.

Parameters:
attributeName - the name of the attribute to retrieve, not null.
attributes - The attributes of the current element.
elementDescription - the description of the parsed element, for producing a user-readable error message. E.g "the optionAction ${nameOfTheAction}"
Returns:
the value of the attribute, or null if the attribute is not set.
Throws:
SAXException - if the attribute contains content other than "true", "1" , "false" or "0".

getUnqualifiedName

public static String getUnqualifiedName(String localName,
                                        String qName)
Retrieves the unqualified part of an XML element name name, regardless whether namespace processing is switched on or off.

Parameters:
localName - The local name (without prefix), or the empty string if namespace processing is not being performed.
qName - The qualified name (with prefix), or the empty string if qualified names are not available.
Returns:
the unqualified part of the name.


Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.