|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.utexas.its.eis.tools.qwicap.template.xml.Markup
edu.utexas.its.eis.tools.qwicap.template.xml.immutable.ImmutableMarkup
public class ImmutableMarkup
ImmutableMarkup
represents a body of XML markup that cannot be altered in any way. The markup
represented may be an entire XML document, or merely a fragment of XML. In either case, well-formedness is required
to the extent that all "start" tags must have matching "end" tags.
Constructor Summary | |
---|---|
ImmutableMarkup(char[] Chars)
Parses a character array containing XML markup; either a well-formed fragment, or an entire XML document. |
|
ImmutableMarkup(char[] Chars,
int Index,
int Limit)
Parses a subsection of a character array containing XML markup; either a well-formed fragment, or an entire XML document. |
|
ImmutableMarkup(MutableMarkup MDoc)
|
Method Summary | |
---|---|
ImmutableMarkup |
clone()
|
Match |
createMatch(Range Element,
int Index)
|
int |
getChangeCount()
Returns a monotonically increasing integer which is incremented every time a modification is made to the markup list. |
String |
getCharacterSet()
Returns the name of the character set in which this markup was encoded when it was read. |
CSSPatterns |
getCSSPatterns(String PatsStr)
Retrieves a compiled version of the specified CSS pattern. |
ImmutableMarkup |
getImmutable()
If this markup is already immutable, this method does nothing, and returns a reference to this object. |
RangeList |
getList()
This method is not part of the public API, but could not be hidden due to limitations in Java's access control system. |
MutableMarkup |
getMutable()
If this markup is already mutable, this method does nothing, and returns a reference to this object. |
String |
toString()
Returns a String representing all the markup stored in this object. |
PrintWriter |
write(PrintWriter Out)
Writes all of the markup stored in this object to a PrintWriter . |
Methods inherited from class edu.utexas.its.eis.tools.qwicap.template.xml.Markup |
---|
checkHierarchy, enumerate, first, get, get, get, getCDATA, getComments, getDeclarations, getMarkupName, isEmpty, iterator, print, setMarkupName, size |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ImmutableMarkup(char[] Chars) throws TagException
Chars
- The array of characters containing the XML markup to be parsed. The array
is retained as the backing store for this body of markup, so under no circumstances
should the contents of the array be modified after invoking this constructor.
TagException
- If there's a problem parsing the XML, verifying its tag hierarchy, or any number of
related problems.public ImmutableMarkup(char[] Chars, int Index, int Limit) throws TagException
Chars
- The array of characters containing the XML markup to be parsed. The array
is retained as the backing store for this body of markup, so under no circumstances
should the contents of the array be modified after invoking this constructor.Index
- The offset of the first character in the array that should be parsed.Limit
- The offset of the character immediately after the last character that should be
parsed.
TagException
- If there's a problem parsing the XML, verifying its tag hierarchy, or any number of
related problems.public ImmutableMarkup(MutableMarkup MDoc) throws TagException
TagException
Method Detail |
---|
public String getCharacterSet()
Markup
getCharacterSet
in class Markup
public ImmutableMarkup clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public CSSPatterns getCSSPatterns(String PatsStr)
Markup
getCSSPatterns
in class Markup
PatsStr
- A CSS2 selector pattern string. See
section 5.1 of the CSS2 specification for basic examples.
CSSPatterns
object that implements the request search pattern.public final int getChangeCount()
Markup
MutableMatch
to detect changes
to the markup list that require them to re-verify the presence and location of the markup
elements they reference. Users of this method should detect changes by testing a cached
change count value for equality with the current change count value. Inequality means there's
been a change. No further assumptions about the values should be made.
getChangeCount
in class Markup
public final RangeList getList()
Markup
List
object that stores all of the elements of this markup.
getList
in class Markup
List
object that stores all the elements in this markup. Do not
modify this List
.Markup.get(int Index)
public final Match createMatch(Range Element, int Index)
createMatch
in class Markup
public ImmutableMarkup getImmutable() throws TagException
Markup
getImmutable
in class Markup
TagException
- If an immutable form of this markup could not be made available.public final MutableMarkup getMutable()
Markup
MutableMarkup
object are references to the immutable markup elements of the original
ImmutableMarkup
object, which makes the creation of the mutable copy of this markup extremely fast
and memory efficient. Only the elements that are eventually modified are converted into mutable forms, and that
conversion is performed both automatically, and transparently.
getMutable
in class Markup
public String toString()
Markup
String
representing all the markup stored in this object.
toString
in class Markup
String
representing all the markup stored in this object.public PrintWriter write(PrintWriter Out) throws IOException
Markup
PrintWriter
.
write
in class Markup
Out
- The PrintWriter
to which this markup will be written.
PrintWriter
that was received as the Out
parameter.
IOException
- If the supplied PrintWriter
has any problem writing.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |