|
||||||||||
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(ExpressionPool pool)
|
Method Summary | |
---|---|
void |
connect(Grammar[] others)
Connect this grammar to other grammars. |
ElementPattern |
createElement(NameClass nc,
Expression contentModel)
Creates a new ElementExp declaration inside this grammar. |
ExpressionPool |
getPool()
|
Expression |
getTopLevel()
|
void |
setPlugs(GrammarImpl.Plug[] plugs)
|
void |
setTopLevel(Expression topLevel)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GrammarImpl(ExpressionPool pool)
Method Detail |
---|
public void setPlugs(GrammarImpl.Plug[] plugs)
public void setTopLevel(Expression topLevel)
public Expression getTopLevel()
public ExpressionPool getPool()
public void connect(Grammar[] others)
public ElementPattern createElement(NameClass nc, 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 |