Package com.iizix.text
Class KStringHTMLImageTag
- java.lang.Object
- com.iizix.text.KStringTag<TARGET>
- com.iizix.text.KStringHTMLTag<TARGET>
- com.iizix.text.KStringHTMLDynamicTag<IImageTarget>
- com.iizix.text.KStringHTMLImageTag
- All Implemented Interfaces:
java.lang.Cloneable
public class KStringHTMLImageTag extends KStringHTMLDynamicTag<IImageTarget>
Class for the dynamic HTML image IMG tag that refers to an image in the application.- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class com.iizix.text.KStringTag
KStringTag.Type
Field Summary
Fields inherited from class com.iizix.text.KStringHTMLTag
isClosed, ordinal
Constructor Summary
Constructors Constructor Description KStringHTMLImageTag(int position, int ordinal, java.util.LinkedHashMap<java.lang.String,java.lang.String> attributes, java.lang.String inputString, int parsePosition)
Creates an Image IMG tag and resolves the "src" attribute.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getHTMLString(java.lang.StringBuilder useme, IKStringInfoProvider provider)
Gets the string representation of this tag in the HTML format.java.lang.String
getPLAINString(java.lang.StringBuilder useme, IKStringInfoProvider provider)
Gets the string representation of this tag in the PLAIN format, i.e.java.lang.String
getPLAINTagText(java.lang.StringBuilder useme)
Gets the "unparsed" string representation of this tag in the PLAIN format, i.e.java.lang.String
getReference()
Gets the "src" reference for the Image reference in the Assets folder.java.lang.Class<?>
getReferenceClass()
Returns the reference class used by this tag, e.g.boolean
setReference(java.lang.String src)
Sets the "src" reference for the Image reference in the Assets folder.void
verify(KStringHolder holder, PropVerification verification, java.lang.String location, int id)
Verifies the KString for a KString holder.boolean
willLoseFormatting()
Checks if this string will lose formatting when translated to PLAIN.Methods inherited from class com.iizix.text.KStringHTMLDynamicTag
getHTMLTagText, isReferenceTag
Methods inherited from class com.iizix.text.KStringHTMLTag
create, disposeTagReference, equalsName, resolve
Methods inherited from class com.iizix.text.KStringTag
appendHTMLAttributes, appendHTMLAttributes, appendHTMLAttributesSkip, appendPLAINAttributes, appendPLAINValue, clone, equals, getAttribute, getReferenceDescription, getReferenceError, getSourceEndPosition, getSourceLength, getSourcePosition, getType, isReferenceValid, isRefreshRequired, isRefreshRequired, setAttribute, setSourceLocation
Constructor Detail
KStringHTMLImageTag
public KStringHTMLImageTag(int position, int ordinal, java.util.LinkedHashMap<java.lang.String,java.lang.String> attributes, java.lang.String inputString, int parsePosition) throws KStringParseException
Creates an Image IMG tag and resolves the "src" attribute.- Parameters:
position
- The position of the tag in the parsed string.attributes
- The tag attributes.inputString
- The input string to KString.parsePosition
- The parsing position where tag starts.- Throws:
KStringParseException
- For missing attributes.
Method Detail
getReference
public java.lang.String getReference()
Gets the "src" reference for the Image reference in the Assets folder.- Specified by:
getReference
in classKStringHTMLDynamicTag<IImageTarget>
- Returns:
- The reference, or null for none.
setReference
public boolean setReference(java.lang.String src)
Sets the "src" reference for the Image reference in the Assets folder.- Overrides:
setReference
in classKStringHTMLTag<IImageTarget>
- Parameters:
src
- The Image reference.- Returns:
- true if changed, false otherwise.
getReferenceClass
public java.lang.Class<?> getReferenceClass()
Returns the reference class used by this tag, e.g. KStringProp for text table, or the image class IImageTarget.class.- Overrides:
getReferenceClass
in classKStringTag<IImageTarget>
- Returns:
- IImageTarget.class.
willLoseFormatting
public 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 classKStringHTMLDynamicTag<IImageTarget>
- Returns:
- Always true.
getPLAINTagText
public java.lang.String getPLAINTagText(java.lang.StringBuilder useme)
Gets 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:
getPLAINTagText
in classKStringHTMLDynamicTag<IImageTarget>
- Returns:
- Empty string always: there is no conversion possible.
getPLAINString
public java.lang.String getPLAINString(java.lang.StringBuilder useme, IKStringInfoProvider provider)
Gets the string representation of this tag in the PLAIN format, i.e. returns empty string.- Specified by:
getPLAINString
in classKStringHTMLDynamicTag<IImageTarget>
- Parameters:
useme
- Temporary StringBuilder for any use.provider
- The information provider or null for none.- Returns:
- Empty string always: no contents for this tag.
getHTMLString
public java.lang.String getHTMLString(java.lang.StringBuilder useme, IKStringInfoProvider provider)
Gets the string representation of this tag in the HTML format. Method needs to be overridden for IZ that replaces the entire tag with an HTML string.- Overrides:
getHTMLString
in classKStringHTMLDynamicTag<IImageTarget>
- Parameters:
useme
- Temporary StringBuilder for any use.provider
- The information provider or null for none.
verify
public void verify(KStringHolder holder, PropVerification verification, java.lang.String location, int id)
Verifies the KString for a KString holder.- Overrides:
verify
in classKStringTag<IImageTarget>
- Parameters:
holder
- The KString holder.verification
- The property verification class.location
- The location.id
- The tag ID.