|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.GrammarImpl
public class GrammarImpl
Implementation of the Grammar
interface with "plugs"
that allows a grammar to be connected to other grammars
when assembled through the context path.
These classes will be freeze-dried to "bgm.ser", so they must be serializable.
This class also implements a trick to allow a large grammar
to be serialized without causing a stack overflow error.
This is done by modifying the ElementExp.contentModel
field
to Expression.nullSet
in the serialized form.
The correct references will be restored after the grammar is
deserialized.
Nested Class Summary | |
---|---|
static class |
GrammarImpl.Plug
Inter-grammar connection that needs be bound. |
Constructor Summary | |
---|---|
GrammarImpl(com.sun.msv.grammar.ExpressionPool pool)
|
Method Summary | |
---|---|
void |
connect(com.sun.msv.grammar.Grammar[] others)
Connect this grammar to other grammars. |
com.sun.msv.grammar.trex.ElementPattern |
createElement(com.sun.msv.grammar.NameClass nc,
com.sun.msv.grammar.Expression contentModel)
Creates a new ElementExp declaration inside this grammar. |
com.sun.msv.grammar.ExpressionPool |
getPool()
|
com.sun.msv.grammar.Expression |
getTopLevel()
|
void |
setPlugs(GrammarImpl.Plug[] plugs)
|
void |
setTopLevel(com.sun.msv.grammar.Expression topLevel)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GrammarImpl(com.sun.msv.grammar.ExpressionPool pool)
Method Detail |
---|
public void setPlugs(GrammarImpl.Plug[] plugs)
public void setTopLevel(com.sun.msv.grammar.Expression topLevel)
public com.sun.msv.grammar.Expression getTopLevel()
getTopLevel
in interface com.sun.msv.grammar.Grammar
public com.sun.msv.grammar.ExpressionPool getPool()
getPool
in interface com.sun.msv.grammar.Grammar
public void connect(com.sun.msv.grammar.Grammar[] others)
public com.sun.msv.grammar.trex.ElementPattern createElement(com.sun.msv.grammar.NameClass nc, com.sun.msv.grammar.Expression contentModel)
ElementExp
declaration inside this grammar.
While the other ordinary ElementExp
s can be also used,
this ElementExp
allows the grammar to be serialized without
too much recursion.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |