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:
Cloneable
- Direct Known Subclasses:
KStringPLAINTextTableTag
,KStringPLAINVirtualSpaceTag
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
Constructor Summary
ConstructorDescriptionKStringPLAINTag
(KStringTag.Type type, String ref, String inputString, int position, LinkedHashMap<String, String> attributes) Creates a VirtualSpace tag for KString that is of type PLAIN.Method Summary
Modifier and TypeMethodDescriptionboolean
equalsName
(KStringTag<?> kst) Checks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).final String
getHTMLTagText
(StringBuilder useme, IKStringInfoProvider provider) Gets the "unparsed" string representation of this tag in the HTML format, e.g.final String
getPLAINTagText
(StringBuilder useme) Gets the "unparsed" string representation of this tag in the PLAIN format.final String
Gets the reference.final boolean
Checks if this tag is of reference type, i.e.boolean
setReference
(String ref) Updates the reference for the tag.final boolean
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, getReferenceError, getReferenceType, getSourceEndPosition, getSourceLength, getSourcePosition, getType, isReferenceValid, isRefreshRequired, isRefreshRequired, resolve, setAttribute, setSourceLocation, verify
Field Details
ref
The name in the text table.
Constructor Details
KStringPLAINTag
public KStringPLAINTag(KStringTag.Type type, String ref, String inputString, int position, LinkedHashMap<String, String> attributes) throws KStringParseExceptionCreates 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 Details
getReference
Gets the reference.- Overrides:
getReference
in classKStringTag<TARGET extends GProp<?>>
- Returns:
- The reference string to the property.
setReference
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:
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
Gets the "unparsed" string representation of this tag in the PLAIN format.- Specified by:
getPLAINTagText
in classKStringTag<TARGET extends GProp<?>>
getHTMLTagText
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
Checks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).- Overrides:
equalsName
in classKStringTag<TARGET extends GProp<?>>