DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema
Class ComplexType

java.lang.Object
  extended by org.dlese.dpc.xml.schema.GenericType
      extended by org.dlese.dpc.xml.schema.SimpleType
          extended by org.dlese.dpc.xml.schema.ComplexType
All Implemented Interfaces:
GlobalDef
Direct Known Subclasses:
ModelGroup

public class ComplexType
extends SimpleType

Wrapper for ComplexType definitions in XML Schemas.

Author:
ostwald

Field Summary
 
Fields inherited from class org.dlese.dpc.xml.schema.GenericType
element, inline, location, name, namespace, path, schemaReader, type, xsdPrefix
 
Fields inherited from interface org.dlese.dpc.xml.schema.GlobalDef
ATTRIBUTE_GROUP, BUILT_IN_TYPE, COMPLEX_TYPE, GENERIC_TYPE, GLOBAL_ATTRIBUTE, GLOBAL_DECLARATION, GLOBAL_ELEMENT, MODEL_GROUP, SIMPLE_TYPE
 
Constructor Summary
ComplexType(Element element, String location, Namespace namespace, SchemaReader schemaReader)
          Constructor for the ComplexType object
 
Method Summary
 List getChoices()
          Returns a list of choice elements if a choise compositor is found, and an empty list otherwise
 Element getComplexContent()
          Gets the complexContent element of the ComplexType object.
 Compositor getCompositor()
          Gets the compositor attribute of the ComplexType object.
 int getCompositorType()
          Gets the compositorType attribute of the ComplexType object
 String getContentModel()
          Gets the contentModel attribute of the ComplexType object
 int getDataType()
          Gets the dataType attribute of the ComplexType object
 String getDerivationBase()
          Gets the derivationBase for derived ComplexTypes.
 GlobalDef getDerivationType()
          Gets the derivationType attribute of the ComplexType object
 int getDerivedCompositorType()
          Gets the derivedCompositorType attribute of the ComplexType object
 String getExtensionBase()
          Gets the name of the extension base type for complex types that derive by extension.
 Element getExtensionElement()
          Gets the extensionElement ComplexType object
 ComplexType getExtensionRootType()
          Recursively traverse the derived Model definitions until a base type definition is found that is not derived from another (via an extension or a restriction).
 GlobalDef getExtensionType()
          Gets the extensionType attribute of the ComplexType object
 String getRestrictionBase()
          Gets the name of the restriction base type for complex types that derive by restriction.
 Element getRestrictionElement()
          Gets the restrictionElement ComplexType object.
 ComplexType getRestrictionRootType()
          Gets the restrictionRootType attribute of the ComplexType object
 GlobalDef getRestrictionType()
          Gets the restrictionType attribute of the ComplexType object
 Element getSimpleContent()
          Gets the simpleContent attribute of the ComplexType object
 String getSimpleContentType()
          Gets the base extension type of the simpleContent element of the ComplexType.
 boolean hasComplexContent()
          Tests for presence of a simpleContent element
 boolean hasInlineCompositor()
          NOT YET DOCUMENTED
 boolean hasSimpleContent()
          Tests for presence of a simpleContent element
 boolean isAbstract()
          Gets the abstract attribute of the ComplexType object
 boolean isDerivedContentModel()
          Returns true if this complexType defines a derived content model (i.e., it has a "complexContent" element as first child.
 boolean isDerivedTextOnlyModel()
          Returns true if this complexType defines a derived text only model (i.e., it has a "simpleContent" element as first child.
 boolean isDerivedType()
          Gets the derivedType attribute of the ComplexType object
protected static void prtln(String s)
          print a string to std out
 String toString()
          String representation of the ComplexType object
 
Methods inherited from class org.dlese.dpc.xml.schema.SimpleType
getEnumerationBaseType, getSimpleEnumerationValues, getUnionMemberTypeDefs, getUnionMemberTypeNames, getUnionMemberTypesAsString, isComboUnionType, isEnumeration, isUnion
 
Methods inherited from class org.dlese.dpc.xml.schema.GenericType
extractDocumentation, filterChildren, filterChildren, getChildren, getDocumentation, getElement, getElementAsXml, getEnumerationValues, getEnumerationValues, getFirstChild, getLocation, getName, getNamespace, getQualifiedInstanceName, getQualifiedName, getSchemaReader, getType, getXsdPrefix, isAnyType, isAttributeGroup, isBuiltIn, isComplexType, isEnumerationType, isGlobalAttribute, isGlobalDeclaration, isGlobalElement, isInline, isModelGroup, isSimpleType, isTypeDef, printElements, setInline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexType

public ComplexType(Element element,
                   String location,
                   Namespace namespace,
                   SchemaReader schemaReader)
Constructor for the ComplexType object

Parameters:
element - Schema element defining type
location - File in which type definition exists
namespace - NOT YET DOCUMENTED
schemaReader - reader instance that processed this definition
Method Detail

getDataType

public int getDataType()
Gets the dataType attribute of the ComplexType object

Specified by:
getDataType in interface GlobalDef
Overrides:
getDataType in class SimpleType
Returns:
COMPLEX_TYPE - The dataType value as an int

getContentModel

public String getContentModel()
Gets the contentModel attribute of the ComplexType object

Returns:
The contentModel value

getCompositor

public Compositor getCompositor()
Gets the compositor attribute of the ComplexType object. ASSUMPTION: compositor element is first child (not including annotation element)

Returns:
The compositor value

hasInlineCompositor

public boolean hasInlineCompositor()
NOT YET DOCUMENTED

Returns:
NOT YET DOCUMENTED

isAbstract

public boolean isAbstract()
Gets the abstract attribute of the ComplexType object

Returns:
The abstract value

getCompositorType

public int getCompositorType()
Gets the compositorType attribute of the ComplexType object

Returns:
The compositorType value

getChoices

public List getChoices()
Returns a list of choice elements if a choise compositor is found, and an empty list otherwise

Returns:
The choices value

isDerivedType

public boolean isDerivedType()
Gets the derivedType attribute of the ComplexType object

Returns:
The derivedType value

isDerivedContentModel

public boolean isDerivedContentModel()
Returns true if this complexType defines a derived content model (i.e., it has a "complexContent" element as first child.

Returns:
The derivedContentModel value

hasComplexContent

public boolean hasComplexContent()
Tests for presence of a simpleContent element

Returns:
true if a simpleContent element is present

getComplexContent

public Element getComplexContent()
Gets the complexContent element of the ComplexType object.

Returns:
The complexContent value or null if not found.

isDerivedTextOnlyModel

public boolean isDerivedTextOnlyModel()
Returns true if this complexType defines a derived text only model (i.e., it has a "simpleContent" element as first child.

Returns:
The derivedTextOnlyModel value

hasSimpleContent

public boolean hasSimpleContent()
Tests for presence of a simpleContent element

Returns:
true if a simpleContent element is present

getSimpleContent

public Element getSimpleContent()
Gets the simpleContent attribute of the ComplexType object

Returns:
The simpleContent value

getSimpleContentType

public String getSimpleContentType()
Gets the base extension type of the simpleContent element of the ComplexType.

Returns:
The base extension type name if this ComplexType has simpleContent, null otherwise.

getDerivedCompositorType

public int getDerivedCompositorType()
Gets the derivedCompositorType attribute of the ComplexType object

Returns:
The derivedCompositorType value

getExtensionElement

public Element getExtensionElement()
Gets the extensionElement ComplexType object

Returns:
The extensionElement or null if not found.

getRestrictionElement

public Element getRestrictionElement()
Gets the restrictionElement ComplexType object.

Returns:
The restrictionElement or null if not found.

getExtensionBase

public String getExtensionBase()
Gets the name of the extension base type for complex types that derive by extension.

Returns:
The extensionBase value or null if not found.

getExtensionType

public GlobalDef getExtensionType()
Gets the extensionType attribute of the ComplexType object

Returns:
The extensionType value

getExtensionRootType

public ComplexType getExtensionRootType()
Recursively traverse the derived Model definitions until a base type definition is found that is not derived from another (via an extension or a restriction).

Returns:
The extensionRootType value

getRestrictionBase

public String getRestrictionBase()
Gets the name of the restriction base type for complex types that derive by restriction.

Returns:
The restrictionBase value or null if not found.

getRestrictionType

public GlobalDef getRestrictionType()
Gets the restrictionType attribute of the ComplexType object

Returns:
The restrictionType value

getRestrictionRootType

public ComplexType getRestrictionRootType()
Gets the restrictionRootType attribute of the ComplexType object

Returns:
The restrictionRootType value

getDerivationBase

public String getDerivationBase()
Gets the derivationBase for derived ComplexTypes.

Returns the base type for restriction or extention elements of either derivedContentModels or derivedTestOnlyModels.

Returns:
The derivationBase value or null if not found.

getDerivationType

public GlobalDef getDerivationType()
Gets the derivationType attribute of the ComplexType object

Returns:
The derivationType value

toString

public String toString()
String representation of the ComplexType object

Specified by:
toString in interface GlobalDef
Overrides:
toString in class SimpleType
Returns:
a String representation of the ComplexType object

prtln

protected static void prtln(String s)
print a string to std out

Parameters:
s - Description of the Parameter

DLESE Tools
v1.6.0