|
GXPARSE hosted by |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.gorman.xml.parse.util.PackageNamespaceElementMapper.NamespaceEntry<T>
public static class PackageNamespaceElementMapper.NamespaceEntry<T extends Parser>
Associates an XML namespace with a Java package and the information
needed to map element names in that namespace to
element handler
classes in the package.
The element local name is mapped to a Java object identifier by replacing XML name characters when the characters are not valid as part of a Java identifier.
The replacement of a character is a string that begins with an escape character. The escape character must be a Java identifier start character, and defaults to the dollar sign ($). The mapping from an XML name character to a string is:
If the character is the escape character, double it else if the character is a java identifier start character, copy it else if not at the start of the identifier and the character is a java identifier part character, copy it else output the escape character, a lower case 'u', and a four-digit lower-case hexadecimal representation of the unicode number.The mapping increases the length of the name, because escape characters in the XML name become two characters in the Java name, and XML characters that are not allowed in a Java name become six characters.
The concatenation of the package name and the new Java identifier are used as the Java class name of element handler. If the handler does not exist, the default handler for the namespace will be used instead.
Constructor Summary | |
---|---|
|
PackageNamespaceElementMapper.NamespaceEntry(QName namespace,
String packageName,
ElementListener<T> namespaceDefaultElementHandler,
String classNamePrefix)
Construct a package and default handler entry for a single namespace. |
protected |
PackageNamespaceElementMapper.NamespaceEntry(QName namespace,
String packageName,
ElementListener<T> namespaceDefaultElementHandler,
String classNamePrefix,
char escapeChar)
Construct a package and default handler entry for a single namespace. |
Method Summary | |
---|---|
String |
getClassNamePrefix()
|
ElementListener<T> |
getNamespaceDefaultElementHandler()
|
String |
getNamespaceURI()
|
String |
getPackageName()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected PackageNamespaceElementMapper.NamespaceEntry(QName namespace, String packageName, ElementListener<T> namespaceDefaultElementHandler, String classNamePrefix, char escapeChar)
Construct a package and default handler entry for a single namespace.
namespace
- XML namespace (only the URI is used).packageName
- the name of the package that holds the element
handlers for the namespacenamespaceDefaultElementHandler
- a default element handler
with a public constructor that takes no parameters. The
default handler is invoked when an element is in the
namespace and the package does not have a specific handler
for that element.classNamePrefix
- a prefix attached to all element names prior
to constructing a Java class name, may be an empty StringescapeChar
- Escape character to identify encoding of a
element name character as a four-digit hexadecimal encoding.
Must be a Java identifier start character.
NullPointerException
- if any reference parameter is null
IllegalArgumentException
- if package packageName
does not exist or is not accessible, or if
escapeChar
is not a Java identifier start
character.public PackageNamespaceElementMapper.NamespaceEntry(QName namespace, String packageName, ElementListener<T> namespaceDefaultElementHandler, String classNamePrefix)
Construct a package and default handler entry for a single namespace.
Uses the dollar symbol
as the
escape character to identify hexadecimal encoding of an element
name character.
namespace
- XML namespace (only the URI is used).packageName
- the name of the package that holds the element
handlers for the namespacenamespaceDefaultElementHandler
- a default element handler
with a public constructor that takes no parameters. The
default handler is invoked when an element is in the
namespace and the package does not have a specific handler
for that element.classNamePrefix
- a prefix attached to all element names prior
to constructing a Java class name, may be an empty String
NullPointerException
- if any parameter is null
IllegalArgumentException
- if package packageName
does not exist or is not accessible.Method Detail |
---|
public String getNamespaceURI()
public String getPackageName()
public String getClassNamePrefix()
public ElementListener<T> getNamespaceDefaultElementHandler()
public String toString()
toString
in class Object
|
GXPARSE download | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |