Package com.sun.msv.generator
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 int
current nest level (depth of elements).private final Document
private final ElementExp[]
all ElementExps in the grammar.private boolean
this flag is set to true once an error is generated.private final Set
Text nodes of IDREFs that should be "patched" by IDs.private final Set
ID tokens that are usedprivate Node
current generated nodeprivate final GeneratorOption
generation parametersprivate final ExpressionPool
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Generator
(Expression exp, Document emptyDoc, GeneratorOption opts) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
cutBack()
returns true if generator should cut back.static void
generate
(Expression exp, Document emptyDoc) generates instance by using default settings.static void
generate
(Expression exp, Document emptyDoc, GeneratorOption opts) generates instance by custom settings.protected StringPair
generateTypo
(StringPair pair) generates 'typo'.private Vector
getChildren
(BinaryExp exp) enumerates children of BinaryExp into a vector.protected ContextProviderImpl
private StringPair
generaets a name that satisfies given NameClassprivate void
annotate DOM by adding a comment that an error is generated.void
void
onAttribute
(AttributeExp exp) void
void
void
void
onElement
(ElementExp exp) void
void
void
void
void
void
onOneOrMore
(OneOrMoreExp exp) void
void
onRef
(ReferenceExp exp) void
onSequence
(SequenceExp exp) void
void
onZeroOrMore
(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:
onEpsilon
in interfaceExpressionVisitorVoid
-
onNullSet
public void onNullSet()- Specified by:
onNullSet
in interfaceExpressionVisitorVoid
-
onSequence
- Specified by:
onSequence
in interfaceExpressionVisitorVoid
-
onInterleave
- Specified by:
onInterleave
in interfaceExpressionVisitorVoid
-
onChoice
- Specified by:
onChoice
in interfaceExpressionVisitorVoid
-
onMixed
- Specified by:
onMixed
in interfaceExpressionVisitorVoid
-
onList
- Specified by:
onList
in interfaceExpressionVisitorVoid
-
onRef
- Specified by:
onRef
in interfaceExpressionVisitorVoid
-
onOther
- Specified by:
onOther
in interfaceExpressionVisitorVoid
-
onAttribute
- Specified by:
onAttribute
in interfaceExpressionVisitorVoid
-
onElement
- Specified by:
onElement
in interfaceExpressionVisitorVoid
-
onAnyString
public void onAnyString()- Specified by:
onAnyString
in interfaceExpressionVisitorVoid
-
onOneOrMore
- Specified by:
onOneOrMore
in interfaceExpressionVisitorVoid
-
onZeroOrMore
-
onValue
- Specified by:
onValue
in interfaceExpressionVisitorVoid
-
onData
- Specified by:
onData
in interfaceExpressionVisitorVoid
-
onConcur
- Specified by:
onConcur
in interfaceExpressionVisitorVoid
-
getContext
-
getName
generaets a name that satisfies given NameClass -
getChildren
enumerates children of BinaryExp into a vector. -
generateTypo
generates 'typo'.
-