|
xArch/xADL 2.0 Data Binding Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uci.isr.xarch.XArchUtils
Utility functions for xArch API implementations. This class is the only one that is XML-parser-dependent.
| Constructor Summary | |
XArchUtils()
|
|
| Method Summary | |
static String |
capFirstLetter(String s)
|
static IXArch |
cloneXArch(IXArch xArchToClone)
Deprecated. Use cloneXArch from an implementation of
IXArchImplementation instead. |
static IXArch |
createXArch()
Deprecated. Use createXArch from an implementation of
IXArchImplementation instead. |
static IXArch |
createXArch(Document doc)
Deprecated. Use parse(Document) from a
DOM-based implementation of
IXArchImplementation instead. |
protected static void |
fixAttribute(Attr attr,
Hashtable prefixMap)
Fixes a specific attribute. |
protected static void |
fixElement(Element elt,
Hashtable prefixMap)
Fixes a specific element. |
protected static void |
fixNamespaces(Document doc)
Fixes the namespace prefixes in a document before it is serialized. |
protected static void |
fixNode(Node n,
Hashtable prefixMap)
Fixes a specific node. |
protected static void |
fixXsiTypeAttribute(Attr attr,
Hashtable prefixMap)
Fixes a specific xsi:type attribute. |
static IXArchImplementation |
getDefaultXArchImplementation()
Returns the default (i.e. |
static DOMImplementation |
getDOMImplementation()
Deprecated. No public replacement. |
static String |
getImplName(String packageName,
String xsiTypeName)
Gets the implementation name for a given xsi:type. |
static String |
getImplNameFromInterfaceName(String interfaceName)
Gets the implementation name for a given interface name. |
static String |
getInterfaceName(String packageName,
String xsiTypeName)
Gets the interface name for a given xsi:type. |
protected static Document |
getOwnerDocument(Node n)
Gets the owner document from a DOM node. |
static String |
getPackageName(String packageTitle)
Gets the full package name given a package title. |
static String[] |
getPackageNames()
Gets a list of subpackages that represent generated APIs for schemas. |
static String |
getPackageTitle(String schemaURI)
Guesses the package title where a given schema URI would have been generated by apigen. |
static String |
getPrettyXmlRepresentation(IXArch xArch)
Deprecated. Use serialize from an implementation of
IXArchImplementation instead. |
protected static String |
getReasonablePrefix(String namespaceURI,
Hashtable prefixMap)
Generate a reasonable namespace prefix based on a namespace URI and a prefix map (to prevent collisions). |
static QName |
getXSIType(Element elt)
Get the xsi:type for a given element. |
static boolean |
isContainedIn(IXArch xArch,
IXArchElement elt)
Deprecated. Use isContainedIn from an implementation of
IXArchImplementation instead. |
static IXArch |
parse(Reader r)
Deprecated. Use parse(Reader) from an implementation of
IXArchImplementation instead. |
static Document |
parseToDocument(Reader r)
Deprecated. No public replacement. |
static String |
uncapFirstLetter(String s)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XArchUtils()
| Method Detail |
public static IXArchImplementation getDefaultXArchImplementation()
public static DOMImplementation getDOMImplementation()
protected static void fixNamespaces(Document doc)
doc - Document on which to fix namespaces.
protected static void fixNode(Node n,
Hashtable prefixMap)
fixNamespaces
n - Node to fix.prefixMap - Prefix<->Namespace URI mappings.
protected static void fixElement(Element elt,
Hashtable prefixMap)
fixNamespaces
elt - Element to fix.prefixMap - Prefix<->Namespace URI mappings.
protected static String getReasonablePrefix(String namespaceURI,
Hashtable prefixMap)
namespaceURI - Namespace URI to use to generate prefixprefixMap - Prefix map.
prefixMap
protected static void fixAttribute(Attr attr,
Hashtable prefixMap)
fixNamespaces
attr - Attribute to fix.prefixMap - Prefix<->Namespace URI mappings.protected static Document getOwnerDocument(Node n)
n - Node for which to get the owner document.
protected static void fixXsiTypeAttribute(Attr attr,
Hashtable prefixMap)
fixNamespaces
attr - xsi:type attribute to fix.prefixMap - Prefix<->Namespace URI mappings.
public static String getPrettyXmlRepresentation(IXArch xArch)
throws DOMException
serialize from an implementation of
IXArchImplementation instead.
xArch - Document to turn into a string.
DOMException
public static Document parseToDocument(Reader r)
throws SAXException,
IOException
r - Reader to parse from.
SAXException - on parse failure
IOException - on I/O failure.
public static IXArch parse(Reader r)
throws SAXException,
IOException
parse(Reader) from an implementation of
IXArchImplementation instead.
r - Reader from which to parse xArch document.
SAXException - if there was a problem parsing the document.
IOException - if there was an I/O error while reading the document.public static IXArch createXArch()
createXArch from an implementation of
IXArchImplementation instead.
public static IXArch cloneXArch(IXArch xArchToClone)
cloneXArch from an implementation of
IXArchImplementation instead.
xArchToClone - The root xArch element of the document to clone.
public static IXArch createXArch(Document doc)
parse(Document) from a
DOM-based implementation of
IXArchImplementation instead.
public static boolean isContainedIn(IXArch xArch,
IXArchElement elt)
isContainedIn from an implementation of
IXArchImplementation instead.
xArch - IXArch to check for the element.elt - Element to check for parentage.
true if the element is attached,
false otherwise.public static String getPackageTitle(String schemaURI)
schemaURI - Schema URI (Namespace URI) from which to guess
package title.
public static String getPackageName(String packageTitle)
packageTitle - Package Title from getPackageTitle()
public static String getInterfaceName(String packageName,
String xsiTypeName)
xsi:type.
Not for public use.
packageName - Package name for the interface.xsiTypeName - xsi:type name.
public static String getImplName(String packageName,
String xsiTypeName)
xsi:type.
Not for public use.
packageName - Package name for the interface.xsiTypeName - xsi:type name.
public static String getImplNameFromInterfaceName(String interfaceName)
interfaceName - Interface class name.
public static String[] getPackageNames()
public static QName getXSIType(Element elt)
xsi:type for a given element. This
function is superior to the one in DOMUtils because it
will actually guess the xsi:type using a tree-walking/reflection
based algorithm when possible.
Not for public use.
elt - Element whose type you want to get.
xsi:type or null if
it can't be determined.public static String capFirstLetter(String s)
public static String uncapFirstLetter(String s)
|
xArch/xADL 2.0 Data Binding Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||