Package com.iizix.text
Class KStringPLAINTag<TARGET extends GProp<?>>
- java.lang.Object
- com.iizix.text.KStringTag<TARGET>
- com.iizix.text.KStringPLAINTag<TARGET>
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
KStringPLAINTextTableTag
,KStringPLAINVirtualSpaceTag
public abstract class KStringPLAINTag<TARGET extends GProp<?>> extends KStringTag<TARGET>
Abstract class used by the PLAIN TextTable, VirtualSpace and Connector tags.- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class com.iizix.text.KStringTag
KStringTag.Type
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
ref
The name in the text table.
Constructor Summary
Constructors Constructor Description KStringPLAINTag(KStringTag.Type type, java.lang.String ref, java.lang.String inputString, int position, java.util.LinkedHashMap<java.lang.String,java.lang.String> attributes)
Creates a VirtualSpace tag for KString that is of type PLAIN.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equalsName(KStringTag<?> kst)
Checks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).java.lang.String
getHTMLTagText(java.lang.StringBuilder useme, IKStringInfoProvider provider)
Gets the "unparsed" string representation of this tag in the HTML format, e.g.java.lang.String
getPLAINTagText(java.lang.StringBuilder useme)
Gets the "unparsed" string representation of this tag in the PLAIN format.java.lang.String
getReference()
Gets the reference.boolean
isReferenceTag()
Checks if this tag is of reference type, i.e.boolean
setReference(java.lang.String ref)
Updates the reference for the tag.boolean
willLoseFormatting()
Checks if this string will lose formatting when translated to PLAIN.Methods inherited from class com.iizix.text.KStringTag
appendHTMLAttributes, appendHTMLAttributes, appendHTMLAttributesSkip, appendPLAINAttributes, appendPLAINValue, clone, disposeTagReference, equals, getAttribute, getHTMLString, getPLAINString, getReferenceClass, getReferenceDescription, getReferenceError, getSourceEndPosition, getSourceLength, getSourcePosition, getType, isReferenceValid, isRefreshRequired, isRefreshRequired, resolve, setAttribute, setSourceLocation, verify
Constructor Detail
KStringPLAINTag
public KStringPLAINTag(KStringTag.Type type, java.lang.String ref, java.lang.String inputString, int position, java.util.LinkedHashMap<java.lang.String,java.lang.String> attributes) throws KStringParseException
Creates a VirtualSpace tag for KString that is of type PLAIN.- Parameters:
type
- The connector type.ref
- The reference value.inputString
- The input string.position
- The position in the character based and parsed string.attributes
- The attributes for the tag.- Throws:
KStringParseException
- If the reference is missing or empty.
Method Detail
getReference
public final java.lang.String getReference()
Gets the reference.- Overrides:
getReference
in classKStringTag<TARGET extends GProp<?>>
- Returns:
- The reference string to the property.
setReference
public boolean setReference(java.lang.String ref)
Updates the reference for the tag.- Specified by:
setReference
in classKStringTag<TARGET extends GProp<?>>
- Parameters:
ref
- The new reference string.- Returns:
- true if changed, false for no change.
- Throws:
java.lang.NullPointerException
- If ref is null.
isReferenceTag
public final boolean isReferenceTag()
Checks if this tag is of reference type, i.e. for HTML, the tags A, IMG, IZ. For PLAIN KString type, this method always returns true.- Specified by:
isReferenceTag
in classKStringTag<TARGET extends GProp<?>>
willLoseFormatting
public final boolean willLoseFormatting()
Checks if this string will lose formatting when translated to PLAIN. Note that translating PLAIN to HTML never loses formatting.- Specified by:
willLoseFormatting
in classKStringTag<TARGET extends GProp<?>>
- Returns:
- Always false.
getPLAINTagText
public final java.lang.String getPLAINTagText(java.lang.StringBuilder useme)
Gets the "unparsed" string representation of this tag in the PLAIN format.- Specified by:
getPLAINTagText
in classKStringTag<TARGET extends GProp<?>>
getHTMLTagText
public final java.lang.String getHTMLTagText(java.lang.StringBuilder useme, IKStringInfoProvider provider)
Gets the "unparsed" string representation of this tag in the HTML format, e.g. this PLAIN tag will reformat or translate itself for HTML with theIZ type="xx" ref="fullPath" [attr=value] ...
.- Specified by:
getHTMLTagText
in classKStringTag<TARGET extends GProp<?>>
- Parameters:
useme
- Temporary StringBuilder for any use.provider
- The information provider or null for none.
equalsName
public boolean equalsName(KStringTag<?> kst)
Checks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).- Overrides:
equalsName
in classKStringTag<TARGET extends GProp<?>>