com.jaxfront.core.schema.impl
Class SchemaNodeImpl

java.lang.Object
  extended by com.jaxfront.core.schema.impl.SchemaNodeImpl
All Implemented Interfaces:
QName, SchemaNode
Direct Known Subclasses:
DummySchemaRoot

public class SchemaNodeImpl
extends java.lang.Object
implements SchemaNode

Represents an XML Schema element from the XML Schema holding a simple or a complex XML SchemaType from the oracle Schema Parser (oracle.xml.parser.schema.XSDNode).

Version:
1.60

Field Summary
static short GLOBAL_ATTRIBUTE
           
static short GLOBAL_ATTRIBUTEGROUP
           
static short GLOBAL_ELEMENT
           
static short GLOBAL_GROUP
           
static short GLOBAL_TYPE
           
static java.lang.String UNNAMED_ELEMENT
           
 
Fields inherited from interface com.jaxfront.core.schema.SchemaNode
NODE_ELEMENT, NODE_TYPE
 
Constructor Summary
SchemaNodeImpl(org.apache.xerces.xs.XSObject node, XMLSchema schema, int minOccurs, int maxOccurs, int unnamedCounter, SchemaNode parent)
          Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.
SchemaNodeImpl(org.apache.xerces.xs.XSObject node, XMLSchema schema, int minOccurs, int maxOccurs, int unnamedCounter, java.lang.String defaultValue, java.lang.String fixedValue, SchemaNode parent, boolean isGlobal)
          Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.
SchemaNodeImpl(org.apache.xerces.xs.XSObject node, XMLSchema schema, int minOccurs, int maxOccurs, int unnamedCounter, java.lang.String defaultValue, java.lang.String fixedValue, SchemaNode parent, boolean isGlobal, boolean initialize)
          Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.
SchemaNodeImpl(org.apache.xerces.xs.XSObject node, XMLSchema schema, int minOccurs, int maxOccurs, SchemaNode parent)
          Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.
SchemaNodeImpl(org.apache.xerces.xs.XSObject node, XMLSchema schema, int minOccurs, int maxOccurs, SchemaNode parent, boolean isGlobal)
           
SchemaNodeImpl(org.apache.xerces.xs.XSObject node, XMLSchema schema, int minOccurs, int maxOccurs, java.lang.String defaultValue, java.lang.String fixedValue, SchemaNode parent)
          Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.
 
Method Summary
static java.lang.String createQName(java.lang.String nameSpace, java.lang.String name)
           
 void finalAnalyse()
           
 java.util.Hashtable getAnnotation()
          Returns annotation for this Schema element.
 int getAnonymousGroupIndex()
           
 java.lang.String getDefaultValue()
          Returns the default value.
 SchemaNode[] getElementSet()
          Returns the element set from the underlying schematype.
 java.lang.String getFixedValue()
          Returns the fixed value.
 java.lang.String getLocation()
          Returns location relative to its root (root or global type/element).
 int getMaxOccurs()
          Returns the cardinality of the maximum occurance of this elment.
 int getMinOccurs()
          Returns the cardinality of the maximum occurance of this elment.
 java.lang.String getName()
          Returns the name specified in the XML Schema (without namespace prefix)
 java.lang.String getNamespace()
           
 java.lang.String getNamespacePrefix()
          Returns the namespace prefix of the current schema element
 org.apache.xerces.xs.XSObject getNode()
           
 SchemaNode getParent()
          Returns the schema element parent or null if this is the root.
 java.lang.String getQName()
          Returns the name specified in the XML Schema (including namespace prefix).
 java.lang.String getRefName()
          Returns name of the referenced type/element in the XML Schema.
 SchemaNode getRoot()
           
 XMLSchema getSchema()
          Returns the whole XML Schema definition.
 java.util.ArrayList getSchemaKeyRefs()
           
 java.util.Hashtable getSchemaKeys()
           
 SchemaType getSchemaType()
          Returns a simple or a complex SchemaType.
 SchemaNode getSubElement(java.lang.String name)
          Returns a direct sub schema element for a given name.
 java.lang.String getTargetNS()
          Returns the target namespace.
 java.lang.String getXPath()
           
 java.lang.String getXPath(SchemaNode root)
           
 boolean hasExtension()
           
 boolean hasSchemaKeyRefs()
           
 boolean hasSchemaKeys()
           
 boolean hasType()
          Returns true if this schema element has an analysed JAXFront type.
 boolean hasUnnamedOptionalParent()
           
 boolean isAnonymous()
          Returns true if this element has no name.
 boolean isChoice()
          Returns true if this element is a choice.
 boolean isGlobal()
          Returns true if this element is a global Schema Element definition.
 boolean isGlobalAttribute()
           
 boolean isGlobalAttributeGroup()
           
 boolean isGlobalElement()
           
 boolean isGlobalGroup()
           
 boolean isGlobalReference()
          Returns true if this element is a global schema element.
 boolean isGlobalType()
           
 boolean isGroup()
          Returns true if this element is a group.
 boolean isReferenceToGlobalElement()
          Returns true if this element is a reference to a global schema Element only!
 boolean isReferenceToGlobalGroup()
           
 boolean isReferenceToGlobalType()
          Returns true if this element is a reference to a global schema Type only!
 boolean isReferenceWithNoExtension()
          Returns true if this element is a reference to another schema element (isRef) or a simple reference to a global type with NO local extensions/restrictions.
 boolean isRequired()
          Returns true if this element is mandatory.
 boolean isSimple()
          Returns true if this element is a leaf.
 void markAsOptional()
          Marks this element as optional.
 void markAsUnnamedOptionalParent()
           
 void putSchemaKey(SchemaNode selectorNode, SchemaKey schemakey)
           
 void putSchemaKeyRef(SchemaNode selectorKeyRefNode, SchemaKeyRef schemakey)
           
 void release()
          Release the resources of this schema element.
 void setAnonymousGroupIndex(int anonymousGroupIndex)
           
 void setGroupRefName(java.lang.String groupRefName)
           
 void setName(java.lang.String name)
           
 void setSchemaType(SchemaType type)
          Sets the SchemaType.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GLOBAL_TYPE

public static final short GLOBAL_TYPE
See Also:
Constant Field Values

GLOBAL_ELEMENT

public static final short GLOBAL_ELEMENT
See Also:
Constant Field Values

GLOBAL_ATTRIBUTE

public static final short GLOBAL_ATTRIBUTE
See Also:
Constant Field Values

GLOBAL_ATTRIBUTEGROUP

public static final short GLOBAL_ATTRIBUTEGROUP
See Also:
Constant Field Values

GLOBAL_GROUP

public static final short GLOBAL_GROUP
See Also:
Constant Field Values

UNNAMED_ELEMENT

public static final java.lang.String UNNAMED_ELEMENT
See Also:
Constant Field Values
Constructor Detail

SchemaNodeImpl

public SchemaNodeImpl(org.apache.xerces.xs.XSObject node,
                      XMLSchema schema,
                      int minOccurs,
                      int maxOccurs,
                      java.lang.String defaultValue,
                      java.lang.String fixedValue,
                      SchemaNode parent)
Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.

Parameters:
node - orcale XSDNode
schema - an XML Schema
minOccurs - min occurs
maxOccurs - max occurs

SchemaNodeImpl

public SchemaNodeImpl(org.apache.xerces.xs.XSObject node,
                      XMLSchema schema,
                      int minOccurs,
                      int maxOccurs,
                      SchemaNode parent)
Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.

Parameters:
node - orcale XSDNode
schema - an XML Schema
minOccurs - min occurs
maxOccurs - max occurs

SchemaNodeImpl

public SchemaNodeImpl(org.apache.xerces.xs.XSObject node,
                      XMLSchema schema,
                      int minOccurs,
                      int maxOccurs,
                      SchemaNode parent,
                      boolean isGlobal)

SchemaNodeImpl

public SchemaNodeImpl(org.apache.xerces.xs.XSObject node,
                      XMLSchema schema,
                      int minOccurs,
                      int maxOccurs,
                      int unnamedCounter,
                      SchemaNode parent)
Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.

Parameters:
node - orcale XSDNode
schema - an XML Schema
minOccurs - min occurs
maxOccurs - max occurs

SchemaNodeImpl

public SchemaNodeImpl(org.apache.xerces.xs.XSObject node,
                      XMLSchema schema,
                      int minOccurs,
                      int maxOccurs,
                      int unnamedCounter,
                      java.lang.String defaultValue,
                      java.lang.String fixedValue,
                      SchemaNode parent,
                      boolean isGlobal)
Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.

Parameters:
node - orcale XSDNode
schema - an XML Schema
minOccurs - min occurs
maxOccurs - max occurs
int - unnamed counter

SchemaNodeImpl

public SchemaNodeImpl(org.apache.xerces.xs.XSObject node,
                      XMLSchema schema,
                      int minOccurs,
                      int maxOccurs,
                      int unnamedCounter,
                      java.lang.String defaultValue,
                      java.lang.String fixedValue,
                      SchemaNode parent,
                      boolean isGlobal,
                      boolean initialize)
Creates an XML Schema element based on a oracle XSDNode, an XML Schema and the cardinalities of this element.

Parameters:
node - orcale XSDNode
schema - an XML Schema
minOccurs - min occurs
maxOccurs - max occurs
int - unnamed counter
Method Detail

finalAnalyse

public void finalAnalyse()

getDefaultValue

public java.lang.String getDefaultValue()
Returns the default value.

Specified by:
getDefaultValue in interface SchemaNode

getFixedValue

public java.lang.String getFixedValue()
Returns the fixed value.

Specified by:
getFixedValue in interface SchemaNode

getMaxOccurs

public int getMaxOccurs()
Returns the cardinality of the maximum occurance of this elment.

Specified by:
getMaxOccurs in interface SchemaNode

getMinOccurs

public int getMinOccurs()
Returns the cardinality of the maximum occurance of this elment.

Specified by:
getMinOccurs in interface SchemaNode

getQName

public java.lang.String getQName()
Description copied from interface: SchemaNode
Returns the name specified in the XML Schema (including namespace prefix).

Specified by:
getQName in interface QName
Specified by:
getQName in interface SchemaNode
Returns:
the name specified in the XML Schema (including namespace prefix)

getName

public java.lang.String getName()
Description copied from interface: SchemaNode
Returns the name specified in the XML Schema (without namespace prefix)

Specified by:
getName in interface QName
Specified by:
getName in interface SchemaNode
Returns:
the name specified in the XML Schema (without namespace prefix)
See Also:
SchemaNode.getName()

getNamespacePrefix

public java.lang.String getNamespacePrefix()
Description copied from interface: SchemaNode
Returns the namespace prefix of the current schema element

Specified by:
getNamespacePrefix in interface SchemaNode
Returns:
the namespace prefix
See Also:
SchemaNode.getNamespacePrefix()

getRefName

public java.lang.String getRefName()
Description copied from interface: SchemaNode
Returns name of the referenced type/element in the XML Schema.

Specified by:
getRefName in interface QName
Specified by:
getRefName in interface SchemaNode
See Also:
SchemaNode.getRefName()

getSchema

public XMLSchema getSchema()
Returns the whole XML Schema definition.

Specified by:
getSchema in interface SchemaNode

getSchemaType

public SchemaType getSchemaType()
Returns a simple or a complex SchemaType.

Specified by:
getSchemaType in interface SchemaNode

getTargetNS

public java.lang.String getTargetNS()
Returns the target namespace.

Specified by:
getTargetNS in interface SchemaNode

hasType

public boolean hasType()
Returns true if this schema element has an analysed JAXFront type.

Specified by:
hasType in interface SchemaNode

getRoot

public SchemaNode getRoot()
Specified by:
getRoot in interface SchemaNode

getXPath

public java.lang.String getXPath()
Specified by:
getXPath in interface SchemaNode

getXPath

public java.lang.String getXPath(SchemaNode root)
Specified by:
getXPath in interface SchemaNode

isAnonymous

public boolean isAnonymous()
Returns true if this element has no name.

Specified by:
isAnonymous in interface SchemaNode

isChoice

public boolean isChoice()
Returns true if this element is a choice.

Specified by:
isChoice in interface SchemaNode

isGlobalReference

public boolean isGlobalReference()
Description copied from interface: SchemaNode
Returns true if this element is a global schema element.

Specified by:
isGlobalReference in interface SchemaNode
See Also:
SchemaNode.isGlobalReference()

isGroup

public boolean isGroup()
Returns true if this element is a group.

Specified by:
isGroup in interface SchemaNode

isRequired

public boolean isRequired()
Returns true if this element is mandatory.

Specified by:
isRequired in interface SchemaNode

isSimple

public boolean isSimple()
Returns true if this element is a leaf.

Specified by:
isSimple in interface SchemaNode

getNode

public org.apache.xerces.xs.XSObject getNode()
Specified by:
getNode in interface SchemaNode

release

public void release()
Description copied from interface: SchemaNode
Release the resources of this schema element.

Specified by:
release in interface SchemaNode
See Also:
SchemaNode.release()

setSchemaType

public void setSchemaType(SchemaType type)
Sets the SchemaType.

Specified by:
setSchemaType in interface SchemaNode
Parameters:
type - XML Schema type (simple or complex)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

markAsOptional

public void markAsOptional()
Description copied from interface: SchemaNode
Marks this element as optional. MinOccurs may be 0.

Specified by:
markAsOptional in interface SchemaNode

getSubElement

public SchemaNode getSubElement(java.lang.String name)
Description copied from interface: SchemaNode
Returns a direct sub schema element for a given name.

Specified by:
getSubElement in interface SchemaNode

isGlobal

public boolean isGlobal()
Description copied from interface: SchemaNode
Returns true if this element is a global Schema Element definition.

Specified by:
isGlobal in interface SchemaNode

getAnnotation

public java.util.Hashtable getAnnotation()
Description copied from interface: SchemaNode
Returns annotation for this Schema element.

Specified by:
getAnnotation in interface SchemaNode

getParent

public SchemaNode getParent()
Description copied from interface: SchemaNode
Returns the schema element parent or null if this is the root.

Specified by:
getParent in interface SchemaNode

getLocation

public java.lang.String getLocation()
Description copied from interface: SchemaNode
Returns location relative to its root (root or global type/element).

Specified by:
getLocation in interface SchemaNode

setName

public void setName(java.lang.String name)

getSchemaKeyRefs

public java.util.ArrayList getSchemaKeyRefs()
Specified by:
getSchemaKeyRefs in interface SchemaNode
See Also:
com.jaxfront.core.schema.SchemaNode#getKeyField()

getSchemaKeys

public java.util.Hashtable getSchemaKeys()
Specified by:
getSchemaKeys in interface SchemaNode
See Also:
com.jaxfront.core.schema.SchemaNode#getKeyField()

hasSchemaKeys

public boolean hasSchemaKeys()
Specified by:
hasSchemaKeys in interface SchemaNode

putSchemaKey

public void putSchemaKey(SchemaNode selectorNode,
                         SchemaKey schemakey)
Specified by:
putSchemaKey in interface SchemaNode
See Also:
com.jaxfront.core.schema.SchemaNode#addKey(com.jaxfront.core.schema.SchemaKey)

hasSchemaKeyRefs

public boolean hasSchemaKeyRefs()
Specified by:
hasSchemaKeyRefs in interface SchemaNode
See Also:
com.jaxfront.core.schema.SchemaNode#isKey()

putSchemaKeyRef

public void putSchemaKeyRef(SchemaNode selectorKeyRefNode,
                            SchemaKeyRef schemakey)
Specified by:
putSchemaKeyRef in interface SchemaNode

getElementSet

public SchemaNode[] getElementSet()
Description copied from interface: SchemaNode
Returns the element set from the underlying schematype.

Specified by:
getElementSet in interface SchemaNode

getNamespace

public java.lang.String getNamespace()
Specified by:
getNamespace in interface QName

createQName

public static java.lang.String createQName(java.lang.String nameSpace,
                                           java.lang.String name)

isReferenceToGlobalType

public boolean isReferenceToGlobalType()
Description copied from interface: SchemaNode
Returns true if this element is a reference to a global schema Type only!

Specified by:
isReferenceToGlobalType in interface SchemaNode

isReferenceToGlobalGroup

public boolean isReferenceToGlobalGroup()
Specified by:
isReferenceToGlobalGroup in interface SchemaNode

isReferenceToGlobalElement

public boolean isReferenceToGlobalElement()
Description copied from interface: SchemaNode
Returns true if this element is a reference to a global schema Element only!

Specified by:
isReferenceToGlobalElement in interface SchemaNode

setGroupRefName

public void setGroupRefName(java.lang.String groupRefName)

hasUnnamedOptionalParent

public boolean hasUnnamedOptionalParent()
Specified by:
hasUnnamedOptionalParent in interface SchemaNode

markAsUnnamedOptionalParent

public void markAsUnnamedOptionalParent()
Specified by:
markAsUnnamedOptionalParent in interface SchemaNode

setAnonymousGroupIndex

public void setAnonymousGroupIndex(int anonymousGroupIndex)
Specified by:
setAnonymousGroupIndex in interface SchemaNode

hasExtension

public boolean hasExtension()
Specified by:
hasExtension in interface SchemaNode

isReferenceWithNoExtension

public boolean isReferenceWithNoExtension()
Description copied from interface: SchemaNode
Returns true if this element is a reference to another schema element (isRef) or a simple reference to a global type with NO local extensions/restrictions.

Specified by:
isReferenceWithNoExtension in interface SchemaNode

getAnonymousGroupIndex

public int getAnonymousGroupIndex()
Specified by:
getAnonymousGroupIndex in interface SchemaNode

isGlobalType

public boolean isGlobalType()
Specified by:
isGlobalType in interface SchemaNode

isGlobalElement

public boolean isGlobalElement()

isGlobalAttribute

public boolean isGlobalAttribute()

isGlobalAttributeGroup

public boolean isGlobalAttributeGroup()

isGlobalGroup

public boolean isGlobalGroup()