Classes | |
class | Namespace |
class | NamespaceEnumerator |
Public Member Functions | |
Namespaces () | |
Namespaces (Namespaces parent) | |
synchronized void | addNamespace (String prefix, String uri) |
Namespaces | createNamespaces () |
Enumeration | getLocalNamespaces () |
String | getNamespaceURI (String prefix) |
String | getNamespacePrefix (String nsURI) |
Enumeration | getLocalNamespacePrefixes () |
String[] | getNamespacePrefixes (String nsURI) |
String[] | getNamespacePrefixes (String nsURI, boolean local) |
String | getNonDefaultNamespacePrefix (String nsURI) |
Namespaces | getParent () |
synchronized boolean | removeNamespace (String prefix) |
void | setParent (Namespaces namespaces) |
void | sendEndEvents (ContentHandler handler) throws SAXException |
void | sendStartEvents (ContentHandler handler) throws SAXException |
void | declareAsAttributes (AttributeListImpl atts, boolean localOnly) |
Static Public Attributes | |
static final String | XML_NAMESPACE_PREFIX = "xml" |
static final String | XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" |
A class for handling Namespace declaration and scoping
org.exolab.castor.xml.Namespaces.Namespaces | ( | ) |
Creates a new Namespaces instance
Referenced by org.exolab.castor.xml.Namespaces.createNamespaces().
org.exolab.castor.xml.Namespaces.Namespaces | ( | Namespaces | parent | ) |
Creates a new Namespaces instance
synchronized void org.exolab.castor.xml.Namespaces.addNamespace | ( | String | prefix, | |
String | uri | |||
) |
Adds the given namespace declaration to this Namespaces
prefix | the namespace prefix | |
uri | the namespace URI to be associated with the given prefix |
References org.exolab.castor.xml.Namespaces.Namespace.next, org.exolab.castor.xml.Namespaces.Namespace.prefix, org.exolab.castor.xml.Namespaces.Namespace.uri, org.exolab.castor.xml.Namespaces.XML_NAMESPACE, and org.exolab.castor.xml.Namespaces.XML_NAMESPACE_PREFIX.
Referenced by org.exolab.castor.xml.schema.Schema.addNamespace(), org.exolab.castor.xml.Marshaller.setNamespaceMapping(), org.exolab.castor.xml.UnmarshalHandler.startElement(), org.exolab.castor.xml.util.SAX2ANY.startElement(), org.exolab.castor.xml.UnmarshalHandler.startPrefixMapping(), org.exolab.castor.xml.util.SAX2ANY.startPrefixMapping(), and org.exolab.castor.xml.util.DocumentHandlerAdapter.startPrefixMapping().
Namespaces org.exolab.castor.xml.Namespaces.createNamespaces | ( | ) |
Creates a new Namespaces instance with this Namespaces as the parent
References org.exolab.castor.xml.Namespaces.Namespaces().
Referenced by org.exolab.castor.xml.UnmarshalHandler.startElement(), org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(), org.exolab.castor.xml.util.SAX2ANY.startElement(), org.exolab.castor.xml.util.DocumentHandlerAdapter.startElement(), org.exolab.castor.xml.UnmarshalHandler.startPrefixMapping(), org.exolab.castor.xml.util.SAX2ANY.startPrefixMapping(), and org.exolab.castor.xml.util.DocumentHandlerAdapter.startPrefixMapping().
void org.exolab.castor.xml.Namespaces.declareAsAttributes | ( | AttributeListImpl | atts, | |
boolean | localOnly | |||
) |
Declare the namespaces of this stack in as attributes.
atts | the Attribute List to fill in. |
References org.exolab.castor.xml.Namespaces.declareAsAttributes(), org.exolab.castor.xml.Namespaces.Namespace.next, org.exolab.castor.xml.Namespaces.Namespace.prefix, and org.exolab.castor.xml.Namespaces.Namespace.uri.
Referenced by org.exolab.castor.xml.Namespaces.declareAsAttributes(), and org.exolab.castor.xml.util.DocumentHandlerAdapter.startElement().
Enumeration org.exolab.castor.xml.Namespaces.getLocalNamespacePrefixes | ( | ) |
Returns all namespace prefixes declared locally
Referenced by org.exolab.castor.xml.schema.util.XMLInstance2SchemaHandler.XMLInstance2SchemaHandler().
Enumeration org.exolab.castor.xml.Namespaces.getLocalNamespaces | ( | ) |
Returns an Enumeration of local namespace URIs for this Namespaces.
String org.exolab.castor.xml.Namespaces.getNamespacePrefix | ( | String | nsURI | ) |
Returns the Namespace prefix associated with the given URI. If multiple namespace prefixes have been declared, then the first one found is returned. To obtain all prefixes see getNamespacePrefixes
.
nsURI | the namespace URI to lookup |
References org.exolab.castor.xml.Namespaces.getNamespacePrefix(), org.exolab.castor.xml.Namespaces.Namespace.next, org.exolab.castor.xml.Namespaces.Namespace.prefix, org.exolab.castor.xml.Namespaces.Namespace.uri, org.exolab.castor.xml.Namespaces.XML_NAMESPACE, and org.exolab.castor.xml.Namespaces.XML_NAMESPACE_PREFIX.
Referenced by org.exolab.castor.xml.UnmarshalHandler.endElement(), org.exolab.castor.xml.schema.Schema.getNamespacePrefix(), org.exolab.castor.xml.Namespaces.getNamespacePrefix(), org.exolab.castor.xml.schema.Schema.isKnownNamespace(), and org.exolab.castor.xml.UnmarshalHandler.startElement().
String [] org.exolab.castor.xml.Namespaces.getNamespacePrefixes | ( | String | nsURI, | |
boolean | local | |||
) |
Returns the Namespace prefixes associated with the given URI.
nsURI | the namespace URI to lookup | |
local | a boolean that when true indicates only the local scope is searched. |
References org.exolab.castor.xml.Namespaces.getNamespacePrefixes().
String [] org.exolab.castor.xml.Namespaces.getNamespacePrefixes | ( | String | nsURI | ) |
Returns all namespace prefixes associated with the given URI, including those from parent scopes.
nsURI | the namespace URI to lookup |
Referenced by org.exolab.castor.xml.Namespaces.getNamespacePrefixes().
String org.exolab.castor.xml.Namespaces.getNamespaceURI | ( | String | prefix | ) |
Returns the Namespace URI associated with the given prefix
prefix | the namespace prefix to lookup |
References org.exolab.castor.xml.Namespaces.getNamespaceURI(), org.exolab.castor.xml.Namespaces.Namespace.next, org.exolab.castor.xml.Namespaces.Namespace.prefix, org.exolab.castor.xml.Namespaces.Namespace.uri, org.exolab.castor.xml.Namespaces.XML_NAMESPACE, and org.exolab.castor.xml.Namespaces.XML_NAMESPACE_PREFIX.
Referenced by org.exolab.castor.xml.schema.Schema.addAttributeGroup(), org.exolab.castor.xml.util.SAX2ANY.endElement(), org.exolab.castor.xml.schema.Schema.getAttribute(), org.exolab.castor.xml.schema.Schema.getAttributeGroup(), org.exolab.castor.xml.schema.Schema.getComplexType(), org.exolab.castor.xml.schema.Schema.getElementDecl(), org.exolab.castor.xml.schema.Schema.getModelGroup(), org.exolab.castor.xml.schema.Schema.getNamespace(), org.exolab.castor.xml.Namespaces.getNamespaceURI(), org.exolab.castor.xml.schema.Schema.getSimpleType(), org.exolab.castor.xml.schema.Schema.getType(), org.exolab.castor.xml.UnmarshalHandler.startElement(), org.exolab.castor.xml.util.SAX2ANY.startElement(), and org.exolab.castor.xml.schema.util.XMLInstance2SchemaHandler.XMLInstance2SchemaHandler().
String org.exolab.castor.xml.Namespaces.getNonDefaultNamespacePrefix | ( | String | nsURI | ) |
Returns the Namespace prefix associated with the given URI. Or null if no prefix has been declared. This method will ignore the default namespace. This is useful when dealing with attributes that do not use the default namespace.
nsURI | the namespace URI to lookup |
References org.exolab.castor.xml.Namespaces.getNonDefaultNamespacePrefix(), org.exolab.castor.xml.Namespaces.Namespace.next, org.exolab.castor.xml.Namespaces.Namespace.prefix, org.exolab.castor.xml.Namespaces.Namespace.uri, org.exolab.castor.xml.Namespaces.XML_NAMESPACE, and org.exolab.castor.xml.Namespaces.XML_NAMESPACE_PREFIX.
Referenced by org.exolab.castor.xml.Namespaces.getNonDefaultNamespacePrefix().
Namespaces org.exolab.castor.xml.Namespaces.getParent | ( | ) |
Returns the parent Namespaces for this Namespaces instance.
Referenced by org.exolab.castor.xml.UnmarshalHandler.endElement(), org.exolab.castor.xml.schema.reader.Sax2ComponentReader.endElement(), org.exolab.castor.xml.util.SAX2ANY.endElement(), and org.exolab.castor.xml.util.DocumentHandlerAdapter.endElement().
synchronized boolean org.exolab.castor.xml.Namespaces.removeNamespace | ( | String | prefix | ) |
Removes the namespace declaration for the given prefix. This is a local action only, the namespace declaration will not be removed from any parent Namespaces object.
prefix | the namespace prefix to remove the binding of |
References org.exolab.castor.xml.Namespaces.Namespace.next, and org.exolab.castor.xml.Namespaces.Namespace.prefix.
Referenced by org.exolab.castor.xml.util.SAX2ANY.endPrefixMapping(), and org.exolab.castor.xml.schema.Schema.removeNamespace().
void org.exolab.castor.xml.Namespaces.sendEndEvents | ( | ContentHandler | handler | ) | throws SAXException |
Calls the given ContentHandler's endPrefixMapping method for each locally declared namespace
handler | the ContentHandler |
References org.exolab.castor.xml.Namespaces.Namespace.next, and org.exolab.castor.xml.Namespaces.Namespace.prefix.
void org.exolab.castor.xml.Namespaces.sendStartEvents | ( | ContentHandler | handler | ) | throws SAXException |
Calls the given ContentHandler's startPrefixMapping method for each locally declared namespace
handler | the ContentHandler |
References org.exolab.castor.xml.Namespaces.Namespace.next, org.exolab.castor.xml.Namespaces.Namespace.prefix, and org.exolab.castor.xml.Namespaces.Namespace.uri.
void org.exolab.castor.xml.Namespaces.setParent | ( | Namespaces | namespaces | ) |
Sets the parent Namespaces for this Namespaces instance.
namespaces | the parent Namespaces |
final String org.exolab.castor.xml.Namespaces.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" [static] |
final String org.exolab.castor.xml.Namespaces.XML_NAMESPACE_PREFIX = "xml" [static] |