Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java 1.0.4 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----com.ibm.xml.parser.ContentModel
Constructor Summary | |
ContentModel(int type)
|
|
ContentModel(CMNode modelGroupNode)
MODEL_GROUP .
|
Method Summary | |
java.lang.Object | clone()
|
CMNode | getContentModelNode()
|
ElementFactory | getFactory()
|
java.lang.String | getPseudoContentModel()
|
void | setContentModelNode(CMNode modelGroupNode)
|
void | setFactory(ElementFactory factory)
|
void | setPseudoContentModel(java.lang.String literal)
|
java.lang.String | toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ContentModel(int type)
type
- The type for this content model.
Must be one of org.w3c.dom.ElementDefinition#ContentType.
Note that the XML4J parser will never set #PCDATA
as the
content type; MODEL_GROUP
will be set instead.
public ContentModel(CMNode modelGroupNode)
MODEL_GROUP
.
modelGroupNode
- The content model associated with the model group.
Method Detail |
public java.lang.Object clone()
public ElementFactory getFactory()
public void setFactory(ElementFactory factory)
factory
- The factory to be used in creating this content model.
public CMNode getContentModelNode()
MODEL_GROUP
.public void setContentModelNode(CMNode modelGroupNode)
MODEL_GROUP
.public java.lang.String toString()
EMPTY
", "ANY
", and
"(HEAD,BODY)
".public java.lang.String getPseudoContentModel()
Pseudo content models are useful when the application does not care about the validity of a document's structure, and wishes to quickly specify a literal string to represent the content model in use. For example, instead of specifying an element declaration as:
CMNode model = new CM1op('*', new CM2op('|', new CM2op('|', new CMLeaf("#PCDATA"), new CMLeaf("FOO")), new CMLeaf("BAR"))); ContentModel cm = factory.createContentModel(model); ElementDecl ed = fatory.createElementDecl("ROOT", cm);
..the same element declaration could be more directly specified as:
ContentModel cm = factory.createContentModel(ElementDecl.MODEL_GROUP); cm.setPseudoContentModel("(#PCDATA|FOO|BAR)*"); ElementDecl ed = factory.createElementDecl("ROOT", cm);
setPseudoContentModel
.public void setPseudoContentModel(java.lang.String literal)
Refer to getPseudoContentModel
for a descripion of pseudo content
models.
literal
- The literal string to be used in place of an actual content model.
Contents | Package | Class | Tree | Deprecated | Index | Help | |||
PREV | NEXT | SHOW LISTS | HIDE LISTS |