DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema.compositor
Class Compositor

java.lang.Object
  extended by org.dlese.dpc.xml.schema.compositor.Compositor
Direct Known Subclasses:
All, Choice, InlineCompositor, Sequence

public abstract class Compositor
extends Object

Compositor class specifies methods for accessing and validating the "members" of a Compositor Element (i.e., All, Sequence and Choice), as well as the acceptsNewMember method. The members are a list of CompositorMember instances which represent the child elements of the compositor element.

Author:
ostwald

Field Summary
static int ALL
          NOT YET DOCUMENTED
protected  CompositorMember anyTypeMember
           
static int CHOICE
          NOT YET DOCUMENTED
protected static boolean debug
          NOT YET DOCUMENTED
protected  Element element
          NOT YET DOCUMENTED
protected  NamespaceRegistry instanceNamespaces
          NOT YET DOCUMENTED
protected  List leafMembers
          NOT YET DOCUMENTED
protected  NamespaceRegistry localNamespaces
          NOT YET DOCUMENTED
protected  int maxOccurs
          NOT YET DOCUMENTED
protected  List members
          NOT YET DOCUMENTED
protected  int minOccurs
          NOT YET DOCUMENTED
protected  String name
          NOT YET DOCUMENTED
protected  ComplexType parent
          NOT YET DOCUMENTED
static int SEQUENCE
          NOT YET DOCUMENTED
static int UNKNOWN
          NOT YET DOCUMENTED
 
Constructor Summary
Compositor(ComplexType parent)
          Constructor for the Compositor object
Compositor(ComplexType parent, Element e)
          Constructor for the Compositor object.
 
Method Summary
abstract  boolean acceptsNewMember(Element instanceDocElement)
          Returns true if a given instance document element can accept a new member according to schema-defined constraints for this compositor.
abstract  boolean acceptsNewMember(Element instanceElement, String memberName, int memberIndex)
          NOT YET DOCUMENTED
 CompositorMember getAnyTypeMember()
           
 Element getElement()
          Gets the element attribute of the Compositor object
 int getIndexOfMember(CompositorMember cm)
          Gets the indexOfMember attribute of the Compositor object
 int getIndexOfMember(String memberName)
          Gets the indexOfMember attribute of the Compositor object
 List getInstanceNames()
          InstanceNames are the instance-qualified names of the members that that cannot be further split into subCompositors.
 CompositorMember getLeafMember(String name)
          Gets the leafMember attribute of the Compositor object
 List getLeafMemberNames()
          Recursively expand the compositor elements to resolve each into one or more membersNames - returning a list collecting all possible member Names that this compositor could contain.
 List getLeafMembers()
          Recursively traverses the element Compositor's elements, collecting CompositorMembers for the leaf elements (those members that can no longer be expanded.
 int getMaxInstanceElements()
          Return the maximum leaf nodes this member could have.
 int getMaxOccurs()
          Gets the maxOccurs attribute of the Compositor object
 CompositorMember getMember(String name)
          Finds a particular Member from the members list
 CompositorMember getMemberAt(int index)
          Gets the memberAt attribute of the Compositor object
 List getMemberNames()
          Returns the instanceNames of the child members of this Compositor
 List getMembers()
          Returns a list of Member instances - one for each element in the choice compositor
 int getMinOccurs()
          Gets the minOccurs attribute of the Compositor object
 String getName()
          Returns string representation of the Compositor's type (e.g., "compositor", "sequence", "all").
 ComplexType getParent()
          Returns the ComplexType instance in which this Compositor is defined.
protected  List getSubstitionGroupMembers(GlobalElement headElement)
          Return a list of CompositoMembers made from the substitionGroup for the given headElement.
protected  List getSubstitionGroupNames(GlobalElement headElement)
          Expands a headElement (a GlobaElement having a substitutionGroup) into the instanceQualified names of it's substitutionGroup members.
 int getType()
          Returns an integer contant that specifies whether this Compositor is Sequence, Choice, All.
 boolean hasAnyTypeMember()
           
 boolean hasMember(String name)
          NOT YET DOCUMENTED
protected  void init()
          Initialize this compositor with occurance information and instantiate compositor members
 String occursInfo()
          NOT YET DOCUMENTED
 void printInstanceNames()
          NOT YET DOCUMENTED
 void printLeafMemberNames()
          NOT YET DOCUMENTED
protected static void prtln(String s)
          NOT YET DOCUMENTED
 String toString()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

protected static boolean debug
NOT YET DOCUMENTED


UNKNOWN

public static final int UNKNOWN
NOT YET DOCUMENTED

See Also:
Constant Field Values

SEQUENCE

public static final int SEQUENCE
NOT YET DOCUMENTED

See Also:
Constant Field Values

CHOICE

public static final int CHOICE
NOT YET DOCUMENTED

See Also:
Constant Field Values

ALL

public static final int ALL
NOT YET DOCUMENTED

See Also:
Constant Field Values

minOccurs

protected int minOccurs
NOT YET DOCUMENTED


maxOccurs

protected int maxOccurs
NOT YET DOCUMENTED


parent

protected ComplexType parent
NOT YET DOCUMENTED


element

protected Element element
NOT YET DOCUMENTED


name

protected String name
NOT YET DOCUMENTED


members

protected List members
NOT YET DOCUMENTED


leafMembers

protected List leafMembers
NOT YET DOCUMENTED


localNamespaces

protected NamespaceRegistry localNamespaces
NOT YET DOCUMENTED


instanceNamespaces

protected NamespaceRegistry instanceNamespaces
NOT YET DOCUMENTED


anyTypeMember

protected CompositorMember anyTypeMember
Constructor Detail

Compositor

public Compositor(ComplexType parent,
                  Element e)
Constructor for the Compositor object. Used to construct InlineCompositor instances

Parameters:
parent - NOT YET DOCUMENTED
e - NOT YET DOCUMENTED

Compositor

public Compositor(ComplexType parent)
Constructor for the Compositor object

Parameters:
parent - NOT YET DOCUMENTED
Method Detail

init

protected void init()
Initialize this compositor with occurance information and instantiate compositor members


hasAnyTypeMember

public boolean hasAnyTypeMember()

getAnyTypeMember

public CompositorMember getAnyTypeMember()

getSubstitionGroupNames

protected List getSubstitionGroupNames(GlobalElement headElement)
Expands a headElement (a GlobaElement having a substitutionGroup) into the instanceQualified names of it's substitutionGroup members.

Parameters:
headElement - NOT YET DOCUMENTED
Returns:
The substitionGroupNames value

getSubstitionGroupMembers

protected List getSubstitionGroupMembers(GlobalElement headElement)
Return a list of CompositoMembers made from the substitionGroup for the given headElement.

Parameters:
headElement - NOT YET DOCUMENTED
Returns:
The substitionGroupMembers value

getLeafMembers

public List getLeafMembers()
Recursively traverses the element Compositor's elements, collecting CompositorMembers for the leaf elements (those members that can no longer be expanded. LeafMembers are important because only they are present in an instanceDocument.

Members that are expanded include Groups and inline Compositors (Sequence, All, Choice).

NOTE: Does this algorithm take derivedContentModels into account?? I.e., how are complexContent (extensions) handled??

Returns:
The leafMembers value

getLeafMemberNames

public List getLeafMemberNames()
Recursively expand the compositor elements to resolve each into one or more membersNames - returning a list collecting all possible member Names that this compositor could contain.

Returns:
The leafMemberNames value

printInstanceNames

public void printInstanceNames()
NOT YET DOCUMENTED


printLeafMemberNames

public void printLeafMemberNames()
NOT YET DOCUMENTED


getType

public int getType()
Returns an integer contant that specifies whether this Compositor is Sequence, Choice, All.

Returns:
The dataType value

getName

public String getName()
Returns string representation of the Compositor's type (e.g., "compositor", "sequence", "all").

Returns:
The type value

getParent

public final ComplexType getParent()
Returns the ComplexType instance in which this Compositor is defined.

Returns:
The location value

getMemberNames

public final List getMemberNames()
Returns the instanceNames of the child members of this Compositor

Returns:
The memberNames value

getInstanceNames

public final List getInstanceNames()
InstanceNames are the instance-qualified names of the members that that cannot be further split into subCompositors.

For headElement members, must we include the substitutionGroupMembers?

Returns:
The instanceNames value

getElement

public final Element getElement()
Gets the element attribute of the Compositor object

Returns:
The element value

getIndexOfMember

public int getIndexOfMember(CompositorMember cm)
Gets the indexOfMember attribute of the Compositor object

Parameters:
cm - NOT YET DOCUMENTED
Returns:
The indexOfMember value

getIndexOfMember

public int getIndexOfMember(String memberName)
Gets the indexOfMember attribute of the Compositor object

Parameters:
memberName - NOT YET DOCUMENTED
Returns:
The indexOfMember value

getMemberAt

public CompositorMember getMemberAt(int index)
Gets the memberAt attribute of the Compositor object

Parameters:
index - NOT YET DOCUMENTED
Returns:
The memberAt value

toString

public String toString()
Description of the Method

Overrides:
toString in class Object
Returns:
Description of the Return Value

occursInfo

public String occursInfo()
NOT YET DOCUMENTED

Returns:
NOT YET DOCUMENTED

acceptsNewMember

public abstract boolean acceptsNewMember(Element instanceDocElement)
Returns true if a given instance document element can accept a new member according to schema-defined constraints for this compositor.

Parameters:
instanceDocElement - NOT YET DOCUMENTED
Returns:
The simpleType value

acceptsNewMember

public abstract boolean acceptsNewMember(Element instanceElement,
                                         String memberName,
                                         int memberIndex)
NOT YET DOCUMENTED

Parameters:
instanceElement - NOT YET DOCUMENTED
memberName - NOT YET DOCUMENTED
memberIndex - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

getMinOccurs

public final int getMinOccurs()
Gets the minOccurs attribute of the Compositor object

Returns:
The minOccurs value

getMaxOccurs

public final int getMaxOccurs()
Gets the maxOccurs attribute of the Compositor object

Returns:
The maxOccurs value

getMaxInstanceElements

public int getMaxInstanceElements()
Return the maximum leaf nodes this member could have.

NOTE: this might be okay for Sequence and All, but it doesn't work for CHOICE compositors, since only one member can contribute PER OCCURRANCE!

Returns:
The maxInstanceElements value

getMembers

public List getMembers()
Returns a list of Member instances - one for each element in the choice compositor

Returns:
The members value

hasMember

public boolean hasMember(String name)
NOT YET DOCUMENTED

Parameters:
name - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

getMember

public CompositorMember getMember(String name)
Finds a particular Member from the members list

Parameters:
name - NOT YET DOCUMENTED
Returns:
The member value

getLeafMember

public CompositorMember getLeafMember(String name)
Gets the leafMember attribute of the Compositor object

Parameters:
name - NOT YET DOCUMENTED
Returns:
The leafMember value

prtln

protected static void prtln(String s)
NOT YET DOCUMENTED

Parameters:
s - NOT YET DOCUMENTED

DLESE Tools
v1.6.0