de.fu_berlin.ties.xml
Class TagConstituent

java.lang.Object
  extended byde.fu_berlin.ties.util.ListEntry
      extended byde.fu_berlin.ties.xml.XMLConstituent
          extended byde.fu_berlin.ties.xml.TagConstituent

public class TagConstituent
extends XMLConstituent

A tag in an XML document. An instance of this class represents a single start tag, end tag or empty tag.

Version:
$Revision: 1.1 $, $Date: 2004/02/02 18:50:16 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
static short EMPTY_TAG
          Type constant: an empty tag.
static short END_TAG
          Type constant: an end tag.
static short START_TAG
          Type constant: a start tag.
 
Constructor Summary
TagConstituent(short constType, String tagName)
          Creates a new instance, automatically generating a suitable representation without attributes (i.e.
TagConstituent(short constType, String tagName, int markupSeries)
          Creates a new instance, automatically generating a suitable representation without attributes (i.e.
TagConstituent(short constType, String tagName, String rep)
          Creates a new instance, without storing a markup series number.
TagConstituent(short constType, String tagName, String rep, int markupSeries)
          Creates a new instance, without setting a reference to a next constituent.
TagConstituent(short constType, String tagName, String rep, int markupSeries, XMLConstituent prevEntry, XMLConstituent nextEntry)
          Creates a new instance.
 
Method Summary
 int getMarkupSeriesNo()
          Returns the number of the markup series this tag is part of.
 String getName()
          Returns the name of this tag.
 TagVariety getVariety()
          Returns the TagVariety of this tag.
 void setMarkupSeriesNo(int i)
          Sets the number of the markup series this tag is part of.
 void setVariety(TagVariety newValue)
          Specifies the TagVariety of this tag.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class de.fu_berlin.ties.xml.XMLConstituent
getRepresentantion, getType, nextConstituent, previousConstituent, setRepresentantion
 
Methods inherited from class de.fu_berlin.ties.util.ListEntry
hasNext, hasPrevious, insertAfter, insertBefore, next, previous, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

START_TAG

public static final short START_TAG
Type constant: a start tag.

See Also:
Constant Field Values

END_TAG

public static final short END_TAG
Type constant: an end tag.

See Also:
Constant Field Values

EMPTY_TAG

public static final short EMPTY_TAG
Type constant: an empty tag.

See Also:
Constant Field Values
Constructor Detail

TagConstituent

public TagConstituent(short constType,
                      String tagName)
               throws IllegalArgumentException
Creates a new instance, automatically generating a suitable representation without attributes (i.e. "<tagName>" for a start tag, "</tagName>" for an end tag, "<tagName/>" for an empty tag).

Parameters:
constType - the typ of this constituent (must be one of the static type constants defined in this class)
tagName - the name of this tag
Throws:
IllegalArgumentException - if constType differs from the static type constants defined in this class

TagConstituent

public TagConstituent(short constType,
                      String tagName,
                      int markupSeries)
               throws IllegalArgumentException
Creates a new instance, automatically generating a suitable representation without attributes (i.e. "<tagName>" for a start tag, "</tagName>" for an end tag, "<tagName/>" for an empty tag).

Parameters:
constType - the typ of this constituent (must be one of the static type constants defined in this class)
tagName - the name of this tag
markupSeries - the number of the markup series this tag is part of
Throws:
IllegalArgumentException - if constType differs from the static type constants defined in this class

TagConstituent

public TagConstituent(short constType,
                      String tagName,
                      String rep)
               throws IllegalArgumentException
Creates a new instance, without storing a markup series number.

Parameters:
constType - the typ of this constituent (must be one of the static type constants defined in this class)
tagName - the name of this tag
rep - the representation of this constituent within the XML document, i.e. the string fragment from the document representing this constituent
Throws:
IllegalArgumentException - if constType differs from the static type constants defined in this class

TagConstituent

public TagConstituent(short constType,
                      String tagName,
                      String rep,
                      int markupSeries)
               throws IllegalArgumentException
Creates a new instance, without setting a reference to a next constituent.

Parameters:
constType - the typ of this constituent (must be one of the static type constants defined in this class)
tagName - the name of this tag
rep - the representation of this constituent within the XML document, i.e. the string fragment from the document representing this constituent
markupSeries - the number of the markup series this tag is part of
Throws:
IllegalArgumentException - if constType differs from the static type constants defined in this class

TagConstituent

public TagConstituent(short constType,
                      String tagName,
                      String rep,
                      int markupSeries,
                      XMLConstituent prevEntry,
                      XMLConstituent nextEntry)
               throws IllegalArgumentException
Creates a new instance.

Parameters:
constType - the typ of this constituent (must be one of the static type constants defined in this class)
tagName - the name of this tag
rep - the representation of this constituent within the XML document, i.e. the string fragment from the document representing this constituent
markupSeries - the number of the markup series this tag is part of
prevEntry - a reference to the previous constituent
nextEntry - a reference to the next constituent
Throws:
IllegalArgumentException - if constType differs from the static type constants defined in this class
Method Detail

getName

public final String getName()
Returns the name of this tag.

Returns:
the tag name

getMarkupSeriesNo

public int getMarkupSeriesNo()
Returns the number of the markup series this tag is part of.

Returns:
the series number; or -1 if the markup series number is not known

getVariety

public TagVariety getVariety()
Returns the TagVariety of this tag. Defaults to TagVariety.REGULAR.

Returns:
the value

setMarkupSeriesNo

public void setMarkupSeriesNo(int i)
Sets the number of the markup series this tag is part of. Tag series are series of tags not interrupted by textual content.

Parameters:
i - the new number

setVariety

public void setVariety(TagVariety newValue)
Specifies the TagVariety of this tag.

Parameters:
newValue - the new value to set

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class XMLConstituent
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.