|
XML for Java Compatibility API 2.0.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.xml.parser.ContentModel
ContentModel provides content model support for element declarations. Refer to ElementDecl for an overview of content models.
ElementDecl, Serialized Form| Constructor Summary | |
ContentModel(CMNode modelGroupNode)
Constructor for content models of type MODEL_GROUP. |
|
ContentModel(int type)
Constructor for content models NOT of type MODEL_GROUP. |
|
| Method Summary | |
java.lang.Object |
clone()
Clone this content model using the appropriate factory. |
boolean |
equals(java.lang.Object obj)
|
CMNode |
getContentModelNode()
Returns the content model associated with this model group content model. |
TXDocument |
getFactory()
Returns the factory used for creating this content model. |
java.lang.String |
getPseudoContentModel()
Returns the pseudo content model being used in place of an actual content model. |
int |
hashCode()
|
void |
setContentModelNode(CMNode modelGroupNode)
Sets the content model associated with this model group content model. |
void |
setFactory(TXDocument factory)
Sets the factory to be used in creating this content model. |
void |
setPseudoContentModel(java.lang.String literal)
Sets the pseudo content model being used in place of an actual content model. |
java.lang.String |
toString()
Returns this content model in XML format. |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
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 boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
EMPTY", "ANY", and
"(HEAD,BODY)".setPseudoContentModel(java.lang.String)public TXDocument getFactory()
setFactory(com.ibm.xml.parser.TXDocument)public void setFactory(TXDocument factory)
factory - The factory to be used in creating this content model.getFactory()public CMNode getContentModelNode()
MODEL_GROUP.setContentModelNode(com.ibm.xml.parser.CMNode)public void setContentModelNode(CMNode modelGroupNode)
MODEL_GROUP.getContentModelNode()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.setPseudoContentModel(java.lang.String)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.getPseudoContentModel()
|
XML for Java Compatibility API 2.0.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||