Class Token
- java.lang.Object
-
- com.sun.identity.install.tools.util.xml.Token
-
- All Implemented Interfaces:
IXMLUtilsConstants
- Direct Known Subclasses:
BoundedToken,CommentToken,DoctypeToken,MetaToken,UnboundedToken,WhiteSpaceToken
public abstract class Token extends Object implements IXMLUtilsConstants
ATokenrepresents a string fragment from within the XML document.
-
-
Field Summary
-
Fields inherited from interface com.sun.identity.install.tools.util.xml.IXMLUtilsConstants
DOCTYPE, NEW_LINE, TOKEN_TYPE_BOUNDED, TOKEN_TYPE_COMMENT, TOKEN_TYPE_DOCTYPE, TOKEN_TYPE_META, TOKEN_TYPE_UNBOUNDED, TOKEN_TYPE_WHITESPACE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringgetTokenString()Returns the string representation of the tokenprotected abstract StringgetTokenTypeString()protected voidsetTokenString(String tokenString)Allows the specialized tokens to manipulate the token string as needed.StringtoDebugString()Returns a string representation of this token including any specific token related details along with it.StringtoString()Returns the string representation of this token.
-
-
-
Constructor Detail
-
Token
protected Token(String tokenString)
Constructs a Token instance using the given string representation of the token.- Parameters:
tokenString- the string representation of the token.
-
-
Method Detail
-
toString
public String toString()
Returns the string representation of this token. If an XML document parse resulted inntokens, then concatenating thetoString()of each of these tokens in the give order will result in the creation of the exact same XML document. If the token was deleted, an empty string is returned.
-
getTokenString
protected String getTokenString()
Returns the string representation of the token- Returns:
-
setTokenString
protected void setTokenString(String tokenString)
Allows the specialized tokens to manipulate the token string as needed.- Parameters:
tokenString- the string representation of the token that will be set from this point onwards.
-
toDebugString
public String toDebugString()
Returns a string representation of this token including any specific token related details along with it.- Returns:
- a string representation of this token including debug information
-
getTokenTypeString
protected abstract String getTokenTypeString()
-
-