|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.utexas.its.eis.tools.qwicap.template.xml.Markup
public abstract class Markup
Markup
represents a body of XML markup. The markup represented may be an entire XML document, or
merely a self-contained fragment. In either case, well-formedness is required to the extent that all "start" tags
must have matching "end" tags, and the "end" tags must be correctly ordered.
Constructor Summary | |
---|---|
Markup()
|
Method Summary | |
---|---|
void |
checkHierarchy()
Performs a simple verification of the tag hierarchy in the XHTML markup represented by this object. |
abstract Match |
createMatch(Range TheElement,
int IndexOfElementInThisMarkup)
|
MarkupEnumeration |
enumerate()
Returns an enumeration for the elements in this markup. |
Results |
first()
Returns a Results object containing a reference to the first start tag in the document. |
Results |
get(CSSPatterns CSSPatts)
Performs a pattern match on this markup using the Cascading Style Sheets level 2 (CSS2) selector scheme, and returns a list of all elements that matched the pattern(s). |
Range |
get(int Index)
Returns an element from this markup. |
Results |
get(String CSSPatterns)
Performs a pattern match on this markup using the Cascading Style Sheets level 2 (CSS2) selector scheme, and returns a list of all elements that matched the pattern(s). |
Results |
getCDATA()
Returns a new Results object listing all of the CDATA (<![CDATA[ … ]]>)
elements in this markup. |
abstract int |
getChangeCount()
Returns a monotonically increasing integer which is incremented every time a modification is made to the markup list. |
abstract String |
getCharacterSet()
Returns the name of the character set in which this markup was encoded when it was read. |
Results |
getComments()
Returns a new Results object listing all of the comment (<!-- … -->)
elements in this markup. |
abstract CSSPatterns |
getCSSPatterns(String PatsStr)
Retrieves a compiled version of the specified CSS pattern. |
Results |
getDeclarations()
Returns a new Results object listing all of the declaration (<! … >)
elements in this markup. |
abstract ImmutableMarkup |
getImmutable()
If this markup is already immutable, this method does nothing, and returns a reference to this object. |
abstract 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. |
String |
getMarkupName()
Returns the name, if any, of this body of markup. |
abstract MutableMarkup |
getMutable()
If this markup is already mutable, this method does nothing, and returns a reference to this object. |
boolean |
isEmpty()
Returns true if this markup contains no elements. |
Iterator<Range> |
iterator()
Returns an Iterator for the elements in this markup. |
void |
print()
Prints this markup to System.out for convenience in debugging. |
void |
setMarkupName(String Name)
Assigns an arbitrary name to this body of markup. |
int |
size()
Returns the number of elements in this markup. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Markup()
Method Detail |
---|
public abstract String getCharacterSet()
public abstract ImmutableMarkup getImmutable() throws TagException
TagException
- If an immutable form of this markup could not be made available.public abstract MutableMarkup getMutable() throws TagException
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.
TagException
- If a mutable form of this markup could not be made available.public final void setMarkupName(String Name)
Name
- The arbitrary name to be assigned to this body of markup.public final String getMarkupName()
null
.public abstract RangeList getList()
List
object that stores all of the elements of this markup.
List
object that stores all the elements in this markup. Do not
modify this List
.get(int Index)
public abstract int getChangeCount()
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.
public final int size()
public final Range get(int Index)
Index
- The index number of the desired markup element.
Range
.public final Results get(String CSSPatterns)
CSSPatterns
- One or more CSS2 selector patterns represented as a String
. See
section 5.1 of the
CSS2 specification for basic examples.
Results
list containing references to each matching element in this
markup.public final Results get(CSSPatterns CSSPatts)
CSSPatts
- One or more CSS2 selector pattern represented as a CSSPatterns
instance.
Results
list containing references to each matching element in this
markup.public Results getDeclarations()
Results
object listing all of the declaration (<! … >)
elements in this markup.
Results
object containing matches for declaration elements.public Results getComments()
Results
object listing all of the comment (<!-- … -->)
elements in this markup.
Results
object containing matches for comment elements.public Results getCDATA()
Results
object listing all of the CDATA (<![CDATA[ … ]]>)
elements in this markup.
Results
object containing matches for CDATA elements.public final Results first()
Results
object containing a reference to the first start tag in the document.
public abstract CSSPatterns getCSSPatterns(String PatsStr)
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 abstract Match createMatch(Range TheElement, int IndexOfElementInThisMarkup)
public final boolean isEmpty()
true
if this markup contains no elements.
true
if this markup contains no elements, false
otherwise.public final MarkupEnumeration enumerate()
MarkupEnumeration
for the elements in this markup.public Iterator<Range> iterator()
Iterator
for the elements in this markup.
iterator
in interface Iterable<Range>
Range
objects that comprise this markup.public void checkHierarchy() throws TagException
TagException
- If that tag hierarchy is incomplete or corrupt.public String toString()
String
representing all the markup stored in this object.
toString
in class Object
String
representing all the markup stored in this object.public void print() throws IOException
System.out
for convenience in debugging.
IOException
- If there was a problem writing to System.out
.write(java.io.PrintWriter)
public PrintWriter write(PrintWriter Out) throws IOException
PrintWriter
.
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 |