public abstract class CompositorGuard
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
instanceMembers
Description of the Field
|
Constructor and Description |
---|
CompositorGuard(Compositor compositor,
org.dom4j.Element instanceElement)
Constructor for the CompositorGuard object
|
CompositorGuard(Compositor compositor,
java.util.List instanceMembers)
Constructor for the CompositorGuard object
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsNewMember()
Will the CompositorGuard allow another member element to be added?
|
boolean |
acceptsNewMember(java.lang.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(java.lang.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,
org.dom4j.Element instanceElement)
Gets the instance attribute of the CompositorGuard class
|
protected abstract java.util.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(java.lang.String name)
Gets the occurrencesCount attribute of the ChoiceGuard object
|
protected int |
getSubOccurrenceCount(CompositorMember cm,
org.dom4j.Element instanceElement)
Gets the subOccurrenceCount attribute of the CompositorGuard object
|
void |
printInstanceMembers()
Description of the Method
|
void |
printOccurrences()
debugging
|
CompositorMember |
resolveLeafNameToCM(java.lang.String leafName)
Given a leaf element name, find the CompositorMember that ultimately
controls it
|
java.lang.String |
resolveLeafNameToCMName(java.lang.String leafName)
Uses resolveLeafNameToCM to return the instanceQualifiedName of the
CompositorMember that controls the leafElement of leafName.
|
java.lang.String |
toString()
NOT YET DOCUMENTED
|
public CompositorGuard(Compositor compositor, org.dom4j.Element instanceElement)
compositor
- NOT YET DOCUMENTEDinstanceElement
- NOT YET DOCUMENTEDpublic CompositorGuard(Compositor compositor, java.util.List instanceMembers)
compositor
- Description of the ParameterinstanceMembers
- Description of the Parameterpublic java.lang.String toString()
toString
in class java.lang.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(java.lang.String memberName, int memberIndex)
memberName
- NOT YET DOCUMENTEDmemberIndex
- NOT YET DOCUMENTEDpublic boolean checkValid() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDpublic Compositor getCompositor()
protected abstract java.util.List getOccurrences() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDprotected final int getSubOccurrenceCount(CompositorMember cm, org.dom4j.Element instanceElement) throws java.lang.Exception
cm
- Description of the ParameterinstanceElement
- Description of the Parameterjava.lang.Exception
- Description of the Exceptionpublic static CompositorGuard getInstance(Compositor compositor, org.dom4j.Element instanceElement)
compositor
- Description of the ParameterinstanceElement
- Description of the Parameterpublic final int getOccurrencesCount()
public final int getOccurrencesCount(java.lang.String name)
name
- NOT YET DOCUMENTEDpublic java.lang.String resolveLeafNameToCMName(java.lang.String leafName) throws java.lang.Exception
leafName
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic CompositorMember resolveLeafNameToCM(java.lang.String leafName) throws java.lang.Exception
leafName
- NOT YET DOCUMENTEDjava.lang.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 DOCUMENTEDpublic org.dlese.dpc.xml.schema.compositor.CompositorGuard.Occurrence findOccurrence(java.lang.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 DOCUMENTEDpublic void printOccurrences()