|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.xml.schema.compositor.CompositorGuard
public abstract class CompositorGuard
The CompositorGuard classes is responsible for enforcing the min and max occurrance schema constraints defined for a Compositor (e.g., All, Choice, or Sequence). CompositorGuards determine whether there is "room" in a given instanceElement for any new members, and what members can be added.
Field Summary | |
---|---|
protected List |
instanceMembers
Description of the Field |
Constructor Summary | |
---|---|
CompositorGuard(Compositor compositor,
Element instanceElement)
Constructor for the CompositorGuard object |
|
CompositorGuard(Compositor compositor,
List instanceMembers)
Constructor for the CompositorGuard object |
Method Summary | |
---|---|
boolean |
acceptsNewMember()
Will the CompositorGuard allow another member element to be added? |
boolean |
acceptsNewMember(String memberName,
int memberIndex)
Tests whether the instance element can accept a new member of "memberName" at the specified memberIndex. |
boolean |
checkValid()
NOT YET DOCUMENTED |
org.dlese.dpc.xml.schema.compositor.CompositorGuard.Occurrence |
findOccurence(CompositorMember cm,
int memberIndex)
NOT YET DOCUMENTED |
org.dlese.dpc.xml.schema.compositor.CompositorGuard.Occurrence |
findOccurrence(String leafName,
int memberIndex)
Find the occurrence containing the nth element of memberName. |
Compositor |
getCompositor()
Gets the compositor attribute of the CompositorGuard object |
static CompositorGuard |
getInstance(Compositor compositor,
Element instanceElement)
Gets the instance attribute of the CompositorGuard class |
protected abstract List |
getOccurrences()
Returns a list of occurrence instances that can be used to determine whether an instance document element satisfies the occurrence constraints of the schema. |
int |
getOccurrencesCount()
Gets the occurrencesCount attribute of the CompositorGuard object |
int |
getOccurrencesCount(String name)
Gets the occurrencesCount attribute of the ChoiceGuard object |
protected int |
getSubOccurrenceCount(CompositorMember cm,
Element instanceElement)
Gets the subOccurrenceCount attribute of the CompositorGuard object |
void |
printInstanceMembers()
Description of the Method |
void |
printOccurrences()
debugging |
CompositorMember |
resolveLeafNameToCM(String leafName)
Given a leaf element name, find the CompositorMember that ultimately controls it |
String |
resolveLeafNameToCMName(String leafName)
Uses resolveLeafNameToCM to return the instanceQualifiedName of the CompositorMember that controls the leafElement of leafName. |
String |
toString()
NOT YET DOCUMENTED |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected List instanceMembers
Constructor Detail |
---|
public CompositorGuard(Compositor compositor, Element instanceElement)
compositor
- NOT YET DOCUMENTEDinstanceElement
- NOT YET DOCUMENTEDpublic CompositorGuard(Compositor compositor, List instanceMembers)
compositor
- Description of the ParameterinstanceMembers
- Description of the ParameterMethod Detail |
---|
public String toString()
toString
in class Object
public boolean acceptsNewMember()
A hook to force validation is provided but not used because we most often are dealing with instanceElements that are not valid (e.g., user has just added a element in the metadata editor). Absent the validity constraint, this method returns if the number of occurrences are less then the number of occurrances allowed by the schema.
public boolean acceptsNewMember(String memberName, int memberIndex)
memberName
- NOT YET DOCUMENTEDmemberIndex
- NOT YET DOCUMENTED
public boolean checkValid() throws Exception
Exception
- NOT YET DOCUMENTEDpublic Compositor getCompositor()
protected abstract List getOccurrences() throws Exception
Exception
- NOT YET DOCUMENTEDprotected final int getSubOccurrenceCount(CompositorMember cm, Element instanceElement) throws Exception
cm
- Description of the ParameterinstanceElement
- Description of the Parameter
Exception
- Description of the Exceptionpublic static CompositorGuard getInstance(Compositor compositor, Element instanceElement)
compositor
- Description of the ParameterinstanceElement
- Description of the Parameter
public final int getOccurrencesCount()
public final int getOccurrencesCount(String name)
name
- NOT YET DOCUMENTED
public String resolveLeafNameToCMName(String leafName) throws Exception
leafName
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic CompositorMember resolveLeafNameToCM(String leafName) throws Exception
leafName
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic void printInstanceMembers()
public org.dlese.dpc.xml.schema.compositor.CompositorGuard.Occurrence findOccurence(CompositorMember cm, int memberIndex)
cm
- NOT YET DOCUMENTEDmemberIndex
- NOT YET DOCUMENTED
public org.dlese.dpc.xml.schema.compositor.CompositorGuard.Occurrence findOccurrence(String leafName, int memberIndex)
Caluclated by traversing the elements in each occurrence, keeping track of how many elements have memberName. When
memberIndex
- NOT YET DOCUMENTEDleafName
- NOT YET DOCUMENTED
public void printOccurrences()
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |