Classes | Public Member Functions | Static Public Attributes

org.exolab.castor.xml.Namespaces Class Reference

List of all members.

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"

Detailed Description

A class for handling Namespace declaration and scoping

Author:
Keith Visco
Version:
Revision:
1.7
Date:
2004/09/10 05:04:08

Constructor & Destructor Documentation

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


Member Function Documentation

synchronized void org.exolab.castor.xml.Namespaces.addNamespace ( String  prefix,
String  uri 
)
Namespaces org.exolab.castor.xml.Namespaces.createNamespaces (  ) 
void org.exolab.castor.xml.Namespaces.declareAsAttributes ( AttributeListImpl  atts,
boolean  localOnly 
)
Enumeration org.exolab.castor.xml.Namespaces.getLocalNamespacePrefixes (  ) 

Returns all namespace prefixes declared locally

Returns:
an Enumeration of locally declared namespace prefixes

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.

Returns:
an Enumeration of local namespace URIs.
String org.exolab.castor.xml.Namespaces.getNamespacePrefix ( String  nsURI  ) 
String [] org.exolab.castor.xml.Namespaces.getNamespacePrefixes ( String  nsURI,
boolean  local 
)

Returns the Namespace prefixes associated with the given URI.

Parameters:
nsURI the namespace URI to lookup
local a boolean that when true indicates only the local scope is searched.
Returns:
the namespace prefixes associated with the given URI

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.

Parameters:
nsURI the namespace URI to lookup
Returns:
the namespace prefixes associated with the given URI

Referenced by org.exolab.castor.xml.Namespaces.getNamespacePrefixes().

String org.exolab.castor.xml.Namespaces.getNamespaceURI ( String  prefix  ) 
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.

Parameters:
nsURI the namespace URI to lookup
Returns:
the namespace prefix associated with the given URI

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 (  ) 
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.

Parameters:
prefix the namespace prefix to remove the binding of
Returns:
true if the namespace declaration was removed, otherwise false.

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

Parameters:
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

Parameters:
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.

Parameters:
namespaces the parent Namespaces

Member Data Documentation

final String org.exolab.castor.xml.Namespaces.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties