Package com.iizix.text
Class KStringHTMLTag<TARGET>
java.lang.Object
com.iizix.text.KStringTag<TARGET>
com.iizix.text.KStringHTMLTag<TARGET>
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- KStringHTMLDynamicTag
Class for the HTML tag entry in the string. If not overridden, it handles the default tags.
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from class com.iizix.text.KStringTag- KStringTag.Type
- Field SummaryFields
- Constructor SummaryConstructorsModifierConstructorDescription- KStringHTMLTag- (int position, int ordinal) Creates a closed tag.- protected- KStringHTMLTag- (KStringTag.Type type, int position, int ordinal, LinkedHashMap<String, - String> attributes) Creates a normal or dynamic tag.
- Method SummaryModifier and TypeMethodDescription- static KStringHTMLTag<?>- create- (int position, int ordinal, LinkedHashMap<String, - String> attributes, String inputString, int parsePosition, boolean isOpenClosed, boolean forEditor) Creates the correct tag class depending on the HTML tag.- protected final voidDisposes of the tag reference, used in the Editor for references.- boolean- equalsName- (KStringTag<?> kst) Checks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).- getHTMLString- (StringBuilder useme, IKStringInfoProvider provider) Gets the string representation of this tag in the HTML format.- getHTMLTagText- (StringBuilder useme, IKStringInfoProvider provider) Gets the "unparsed" string representation of this tag in the HTML format.- getPLAINString- (StringBuilder useme, IKStringInfoProvider provider) Gets the string representation of this tag in the PLAIN format, i.e.- getPLAINTagText- (StringBuilder useme) Gets the "unparsed" string representation of this tag in the PLAIN format, i.e.- booleanChecks if this tag is of reference type, i.e.- void- resolve- (KStringHolder holder, boolean doReCheck, GEvent triggerEvent) Resolves the reference.- boolean- setReference- (String ref) Updates the tag reference.- booleanChecks if this string will lose formatting when translated to PLAIN.- Methods inherited from class com.iizix.text.KStringTag- appendHTMLAttributes, appendHTMLAttributes, appendHTMLAttributesSkip, appendPLAINAttributes, appendPLAINValue, clone, equals, getAttribute, getReference, getReferenceClass, getReferenceError, getReferenceType, getSourceEndPosition, getSourceLength, getSourcePosition, getType, isReferenceValid, isRefreshRequired, isRefreshRequired, setAttribute, setSourceLocation, verify
- Field Details- ordinalprotected final int ordinalThe ordinal.
- isClosedprotected final boolean isClosedTag closed flag.
 
- Constructor Details- KStringHTMLTagprotected KStringHTMLTag- (KStringTag.Type type, int position, int ordinal, LinkedHashMap<String, - String> attributes) Creates a normal or dynamic tag.- Parameters:
- position- The position of the tag in the parsed string.
- ordinal- The ordinal of the tag.
- attributes- The tag attributes.
 
- KStringHTMLTagpublic KStringHTMLTag- (int position, int ordinal) Creates a closed tag.
 
- Method Details- createpublic static KStringHTMLTag<?> create- (int position, int ordinal, LinkedHashMap<String, - String> attributes, String inputString, int parsePosition, boolean isOpenClosed, boolean forEditor) throws KStringParseExceptionCreates the correct tag class depending on the HTML tag.- Parameters:
- position- The position of the tag in the parsed string.
- ordinal- The ordinal of the tag.
- attributes- The tag attributes.
- inputString- The input string to KString.
- parsePosition- The parsing position where tag starts.
- forEditor- Flag indicating an INPUT tag has been replaced with IZ.
- Returns:
- The new HTML tag instance that corresponds with the tag name.
- Throws:
- KStringParseException- For invalid tag name or reference/missing attributes.
 
- disposeTagReferenceprotected final void disposeTagReference()Disposes of the tag reference, used in the Editor for references.- Overrides:
- disposeTagReferencein class- KStringTag<TARGET>
 
- willLoseFormattingpublic boolean willLoseFormatting()Checks if this string will lose formatting when translated to PLAIN. Note that translating PLAIN to HTML never loses formatting.- Specified by:
- willLoseFormattingin class- KStringTag<TARGET>
- Returns:
- Always true for opened tags.
 
- isReferenceTagpublic 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:
- isReferenceTagin class- KStringTag<TARGET>
 
- getPLAINTagTextGets the "unparsed" string representation of this tag in the PLAIN format, i.e. this HTML tag will reformat or translate itself for PLAIN. For the basic HTML tags, this results in an empty string.- Specified by:
- getPLAINTagTextin class- KStringTag<TARGET>
 
- getHTMLTagTextGets the "unparsed" string representation of this tag in the HTML format.- Specified by:
- getHTMLTagTextin class- KStringTag<TARGET>
- Parameters:
- useme- Temporary StringBuilder for any use.
- provider- The information provider or null for none.
 
- getPLAINStringGets the string representation of this tag in the PLAIN format, i.e. returns empty string.- The only tag [BR] returns [LF] character code 0x10. - Specified by:
- getPLAINStringin class- KStringTag<TARGET>
- Parameters:
- useme- Temporary StringBuilder for any use.
- provider- The information provider or null for none.
 
- getHTMLStringGets the string representation of this tag in the HTML format.- Specified by:
- getHTMLStringin class- KStringTag<TARGET>
- Parameters:
- useme- Temporary StringBuilder for any use.
- provider- The information provider or null for none.
 
- equalsNameChecks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).- Overrides:
- equalsNamein class- KStringTag<TARGET>
 
- setReferenceUpdates the tag reference.- Specified by:
- setReferencein class- KStringTag<TARGET>
- Parameters:
- ref- The new reference.
- Returns:
- true if changed, false for no change.
 
- resolveResolves the reference. This method checks for any on* attributes for VS component references.- Overrides:
- resolvein class- KStringTag<TARGET>
- Parameters:
- holder- The KString holder.
- doReCheck- Rechecks the references.
- triggerEvent- The trigger event.