Class Generator
java.lang.Object
com.sun.msv.generator.Generator
- All Implemented Interfaces:
ExpressionVisitorVoid
generates an XML DOM instance that conforms to the given schema.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AttributeExp[]all AttributeExps in the grammar.private intcurrent nest level (depth of elements).private final Documentprivate final ElementExp[]all ElementExps in the grammar.private booleanthis flag is set to true once an error is generated.private final SetText nodes of IDREFs that should be "patched" by IDs.private final SetID tokens that are usedprivate Nodecurrent generated nodeprivate final GeneratorOptiongeneration parametersprivate final ExpressionPool -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGenerator(Expression exp, Document emptyDoc, GeneratorOption opts) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancutBack()returns true if generator should cut back.static voidgenerate(Expression exp, Document emptyDoc) generates instance by using default settings.static voidgenerate(Expression exp, Document emptyDoc, GeneratorOption opts) generates instance by custom settings.protected StringPairgenerateTypo(StringPair pair) generates 'typo'.private VectorgetChildren(BinaryExp exp) enumerates children of BinaryExp into a vector.protected ContextProviderImplprivate StringPairgeneraets a name that satisfies given NameClassprivate voidannotate DOM by adding a comment that an error is generated.voidvoidonAttribute(AttributeExp exp) voidvoidvoidvoidonElement(ElementExp exp) voidvoidvoidvoidvoidvoidonOneOrMore(OneOrMoreExp exp) voidvoidonRef(ReferenceExp exp) voidonSequence(SequenceExp exp) voidvoidonZeroOrMore(OneOrMoreExp exp)
-
Field Details
-
opts
generation parameters -
pool
-
domDoc
-
node
current generated node -
depth
private int depthcurrent nest level (depth of elements). -
errorGenerated
private boolean errorGeneratedthis flag is set to true once an error is generated. -
ids
ID tokens that are used -
idrefs
Text nodes of IDREFs that should be "patched" by IDs. -
elementDecls
all ElementExps in the grammar. -
attributeDecls
all AttributeExps in the grammar.
-
-
Constructor Details
-
Generator
-
-
Method Details
-
cutBack
protected boolean cutBack()returns true if generator should cut back. -
generate
generates instance by using default settings. -
generate
generates instance by custom settings. -
noteError
annotate DOM by adding a comment that an error is generated. -
onEpsilon
public void onEpsilon()- Specified by:
onEpsilonin interfaceExpressionVisitorVoid
-
onNullSet
public void onNullSet()- Specified by:
onNullSetin interfaceExpressionVisitorVoid
-
onSequence
- Specified by:
onSequencein interfaceExpressionVisitorVoid
-
onInterleave
- Specified by:
onInterleavein interfaceExpressionVisitorVoid
-
onChoice
- Specified by:
onChoicein interfaceExpressionVisitorVoid
-
onMixed
- Specified by:
onMixedin interfaceExpressionVisitorVoid
-
onList
- Specified by:
onListin interfaceExpressionVisitorVoid
-
onRef
- Specified by:
onRefin interfaceExpressionVisitorVoid
-
onOther
- Specified by:
onOtherin interfaceExpressionVisitorVoid
-
onAttribute
- Specified by:
onAttributein interfaceExpressionVisitorVoid
-
onElement
- Specified by:
onElementin interfaceExpressionVisitorVoid
-
onAnyString
public void onAnyString()- Specified by:
onAnyStringin interfaceExpressionVisitorVoid
-
onOneOrMore
- Specified by:
onOneOrMorein interfaceExpressionVisitorVoid
-
onZeroOrMore
-
onValue
- Specified by:
onValuein interfaceExpressionVisitorVoid
-
onData
- Specified by:
onDatain interfaceExpressionVisitorVoid
-
onConcur
- Specified by:
onConcurin interfaceExpressionVisitorVoid
-
getContext
-
getName
generaets a name that satisfies given NameClass -
getChildren
-
generateTypo
generates 'typo'.
-