Class GlobalDefMap

java.lang.Object
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
  • Simple and ComplexType definitions,
  • Goup definitions, and
  • Global Element and Global Attribute declarations

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 Details

    • GlobalDefMap

      public GlobalDefMap()
  • Method Details

    • 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, org.dom4j.Namespace ns)
    • getValue

      public GlobalDef getValue(String name, String nsUri)
    • setValue

      public void setValue(String name, GlobalDef def, org.dom4j.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)