Package com.sun.msv.reader.trex.ng
Class RestrictionChecker.DuplicateNameChecker
java.lang.Object
com.sun.msv.reader.trex.ng.RestrictionChecker.DuplicateNameChecker
- Enclosing class:
- RestrictionChecker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected int[]areas.protected NameClassAndExpression[]ElementExps will be added into this array.protected intNumber of items in the atts array. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds newly found element or attribute.protected abstract voidtests a given exp against existing expressions (which are stored in the exps field.)protected voidcheck(NameClassAndExpression newExp, NameClassAndExpression oldExp) Tests two name classes to see if they collide.voidendLeftBranch(int start) voidprotected abstract StringGets the error message resource name.intstart()
-
Field Details
-
exps
ElementExps will be added into this array. -
expsLen
protected int expsLenNumber of items in the atts array. -
areas
protected int[] areasareas.An area is a range of index designated by the start and end. Areas are stored as:
{ start, end, start, end, ... }The start method gives the index. The endLeftBranch method creates an area by using the start index given by the start method. The endRightBranch method will remove the area.
When testing duplicate attributes, areas are created by ChoiceExp and used to exclude test candidates (as two attributes can share the same name if they are in different branches of choice.)
When testing duplicate elements, areas are created by InterleaveExp and used to include test candidates (as two elements cannot share the same name if they are in different branches of interleave.)
-
areaLen
protected int areaLen
-
-
Constructor Details
-
DuplicateNameChecker
protected DuplicateNameChecker()
-
-
Method Details
-
add
Adds newly found element or attribute. -
check
tests a given exp against existing expressions (which are stored in the exps field.) -
start
public int start() -
endLeftBranch
public void endLeftBranch(int start) -
endRightBranch
public void endRightBranch() -
check
Tests two name classes to see if they collide. -
getErrorMessage
Gets the error message resource name.
-