DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema
Class GlobalDefMap

java.lang.Object
  extended by org.dlese.dpc.xml.schema.GlobalDefMap

public class GlobalDefMap
extends Object

Stores GlobalDef instances, which are wrappers for important elements of an XML Schema, including

The definitions are stored in a two-level mapping. The first level is by namespaceUri, so there is a map for each namespace. The individual namespace maps store all the GlobalDefs for that namespace. To access a particular globalDefinition, the name of the definition (e.g., the type name) is required, as well as the namespaceUri for the namespace in which the definition is defined.

This class also contains a NamespaceRegistry that stores the namespaces defined at the global level of the schema. NOTE: it is possible that schemafiles define and use namespaces that are not visible at the top-level of the schema. In this case, there will be entries in the GlobalDefMap for these namespaces, but the namespaces themselves will not be registered in the NamespaceRegistry.

Author:
ostwald

Constructor Summary
GlobalDefMap()
           
 
Method Summary
 boolean containsKey(String key)
          Description of the Method
 void destroy()
          Should release resources and call the finalize method.
 List getComplexTypes()
           
 List getDefsOfType(int type)
           
 NamespaceRegistry getNamespaces()
           
 List getNsKeys()
          Method to retrieve the list of names used to identify desired values.
 Map getNsMap(String nsUri)
           
 List getNsValues(String nsUri)
          Retrieves GlobalDefs associated with specified Namespace.
 List getSimpleTypes()
           
 GlobalDef getValue(String name)
          Accessor method for retrieving a specific named GlobalDef.
 GlobalDef getValue(String name, Namespace ns)
           
 GlobalDef getValue(String name, String nsUri)
           
 List getValues()
           
 boolean init()
          Should initialize members as required.
static void setDebug(boolean d)
           
 void setValue(String name, GlobalDef def, Namespace ns)
          Inserts a GlobalDef instance in the GlobalDefMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalDefMap

public GlobalDefMap()
Method Detail

init

public boolean init()
Should initialize members as required.

Returns:
true if intialization successful, false otherwise

getNamespaces

public NamespaceRegistry getNamespaces()

destroy

public void destroy()
Should release resources and call the finalize method.


containsKey

public boolean containsKey(String key)
Description of the Method

Parameters:
key - Description of the Parameter
Returns:
Description of the Return Value

getNsKeys

public List getNsKeys()
Method to retrieve the list of names used to identify desired values.

Returns:
The keys value

getValues

public List getValues()

getNsMap

public Map getNsMap(String nsUri)

getSimpleTypes

public List getSimpleTypes()

getComplexTypes

public List getComplexTypes()

getDefsOfType

public List getDefsOfType(int type)

getNsValues

public List getNsValues(String nsUri)
Retrieves GlobalDefs associated with specified Namespace.

Returns:
The values value

getValue

public GlobalDef getValue(String name)
Accessor method for retrieving a specific named GlobalDef. Namespace prefixes for the default name space (or the targetNameSpace if there is no defaultNamespace defined), are stripped.

Parameters:
name - Description of the Parameter
Returns:
The value value

getValue

public GlobalDef getValue(String name,
                          Namespace ns)

getValue

public GlobalDef getValue(String name,
                          String nsUri)

setValue

public void setValue(String name,
                     GlobalDef def,
                     Namespace ns)
              throws Exception
Inserts a GlobalDef instance in the GlobalDefMap.

Parameters:
name - The GlobalDef name
def - The globalDef object
Throws:
Exception - if the GlobalDef is already in the map

setDebug

public static void setDebug(boolean d)

DLESE Tools
v1.6.0