All Implemented Interfaces:
Serializable
A representation of a content model. A content model is
basically a restricted BNF expression. It is restricted in
the sense that it must be deterministic. This means that you
don't have to represent it as a finite state automaton.
See Annex H on page 556 of the SGML handbook for more information.
Field Summary
Fields
The next content model (in a ',', '|' or '&' expression).
int
Constructor Summary
Constructors
Create a content model of a particular type.
Create a content model of a particular type.
Create a content model for an element.
Method Summary
All Methods Instance Methods Concrete Methods
boolean
Return true if the content model could
match an empty input stream.
Return the element that must be next.
boolean
Return true if the token could potentially be the
first token in the input stream.
void
Update elemVec with the list of elements that are
part of the this contentModel.
Field Details
type
public int type
Type. Either '*', '?', '+', ',', '|', '&'.
content
The content. Either an Element or a ContentModel.
next
The next content model (in a ',', '|' or '&' expression).
Constructor Details
ContentModel
public ContentModel ()
Creates ContentModel
ContentModel
public ContentModel (Element content)
Create a content model for an element.
Parameters:
content
- the element
ContentModel
Create a content model of a particular type.
Parameters:
type
- the type
content
- the content
ContentModel
Create a content model of a particular type.
Parameters:
type
- the type
content
- the content
next
- the next content model
Method Details
empty
public boolean empty ()
Return true if the content model could
match an empty input stream.
Returns:
true
if the content model could
match an empty input stream
getElements
Update elemVec with the list of elements that are
part of the this contentModel.
Parameters:
elemVec
- the list of elements
first
public boolean first (Object token)
Return true if the token could potentially be the
first token in the input stream.
Parameters:
token
- the token
Returns:
true
if the token could potentially be the first token
in the input stream
first
Return the element that must be next.
Returns:
the element that must be next
toString
Convert to a string.
Overrides:
toString
in class Object
Returns:
the string representation of this ContentModel
Report a bug or suggest an enhancement For further API reference and developer documentation see the Java SE Documentation , which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions. Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries. Copyright © 1993, 2022, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA. All rights reserved. Use is subject to license terms and the documentation redistribution policy .