Class KString
- All Implemented Interfaces:
Cloneable, Comparable<KString>
- Direct Known Subclasses:
KStringStyled, PlainKString
To perform fast, a KString can have its contents parsed at creation time for any tags, or this can be set as a parameter. The references can be retrieved as well. When stored into XML, the string is parsed references are written to XML.
HTML strings
The following rules apply to the HTML strings:
(Note: [] are replacements for <>)
- White space characters CR/LF/Tab/Space characters are replaced with spaces. As the W3C specification states, note that although 
 and 
 are defined in ISO10646 to unambiguously separate lines and paragraphs, respectively, these do not constitute line breaks in HTML.
- More than one white spaces are merged into a single white space when not inside a [PRE] element (preformatted text).
- Valid tags: B, I, U, EM, STRONG, BR, P, CODE, PRE, A, IMG, SPAN, DIV, FONT, SUP, SUB, TT, STRIKE, S, HR, CITE, DFN, SAMP, KBD, VAR, ABBR, ACRONYM, ADDRESS, ARTICLE, ASIDE, AUDIO, DATA, DETAILS, SUMMARY, FIGCAPTION, FIGURE, FOOTER, HEADER, MAIN, MARK, METER, NAV, PICTURE, SOURCE, PROGRESS, SECTION, TIME, VIDEO, TRACK, WBR, Q, BLOCKQUOTE, BIG, SMALL, BDI, BDO, INS, DEL, UL, OL, LI, DL, DT, DD, TABLE, CAPTION, COL, COLGROUP, SITE, THEAD, TFOOT, TBODY, TR, TH, TD, H1, H2, H3, H4, H5, H6.
- SVG is supported, see below. The tag table is one flat set, so every SVG tag is accepted in HTML context as well.
- Additionally, the IZ tag is defined as described below.
- A KString comes in three kinds, and the kind decides what the parser admits (see
KString.Kind):- The classical kind, created by every constructor of this class, is SAFE by default: SCRIPT, IFRAME, STYLE and FOREIGNOBJECT are refused; every attribute whose name starts with "on" is refused except "onclick" and "ondblclick", whose value must be a VirtualSpace component reference of the hyperlink machinery (or the client's generated handler for one); URL attributes such as "href" and "src" refuse the "javascript:", "vbscript:" and non-image "data:" schemes; an SVG animation may not retarget a URL or an event attribute. Text that did not come from the application's author belongs in this kind.
- The trusted kind, created by
newTrustedHTMLKString(String,boolean), is for HTML the application vouches for: the four tags above are accepted and no attribute value is inspected; the two event attribute names remain the only "on" names accepted. It parses, resolves references, formats and verifies exactly as the classical kind does. - The trusted unparsed kind, created by
newTrustedUnparsedHTMLKString(String), is never parsed: a whole page of generated markup passed to the client as it is, with no tags, no references and no formatting.
HTMLUtilities.escapeString(String,boolean)) or it is parsed as markup. - The following tags are not allowed to have a close tag (e.g. </BR>): BR, IZ.
Unsupported tags: LINK, HEAD, NOSCRIPT, TITLE, META, BODY, HTML, OBJECT, APPLET, BASE, DATALIST, DIALOG, DIR, FRAMESET, FRAME, NOFRAMES, PARAM, FORM, INPUT, BUTTON, LABEL, SELECT, OPTION, OPTGROUP, OUTPUT, TEMPLATE, TEXTAREA, ISINDEX, FIELDSET, LEDGEND, CENTER, AREA, MAP, RUBY, RP, RT.
Some new HTML5 tags are not supported either.
The following tags are used by IIZI (where [] indicate optional attribute). Every reference is carried by the "ref" attribute; the type strings are the lower-case ones below, as the tag factory matches them:
- IZ type="tt" ref="textID"
- Reference to the text table with the full text ID "id".
- IZ type="vs" ref="fullPath" [format="vsFieldFormatString"]
- Text retrieval from a VirtualSpace field with the specified "name", with optional "format" string, specific to the data type of the VirtualSpace field.
- A ref="fullPath" type="resource|vs|panel" [format="VSField-specific"] [attr1="value1" ...customAttrValuePairs... attrN="valueN"]
- Hyperlink reference to the "fullPath" that can be of "type":
- resource
link opens a new page to e.g. a HTML page, a video. - vs
link performs the associated VirtualSpace action. - panel
link changes to another panel.
- resource
- A type="external" href="url"
- An ordinary hyperlink to a URL outside the application; the only A form that uses "href".
- There is no "connector" type: it is refused in HTML ("Unknown IZ HTML tag type") and in PLAIN ("Unknown tag: connector"), see the register entry IIZI-KSTRING-CONNECTOR-TAG-ABSENT.
- IMG src="fullPath" [alt="textDescription"] [width="150"] [height="60"]
- An image in the application, with an optional tooltip "textDescription" and a size (overrides the image size) of "width" and "height". The "fullPath" specifies the image resource path in the application (e.g. not on the web such as "http://something.com/image.gif". The "src" URL attribute is set to point correctly to the image for the end-user application at runtime.
Normal string
Normal strings are by its nature limited to the single functionality of retrieving a text, as opposed to HTML tags that e.g. also can request an action.
Tags are declared enclosed in curly brackets. The have the format:
{type=value attr=value ... attrN=valueN}
Rules for the format:- To have a curly bracket '{' in the string as a character, double it "{{".
- Attribute-value pairs are separated by one or more white space characters (space, tab, carriage return or linefeed).
- Valid characters in an attribute name are valid Unicode characters with a code point above 32 (space), except the equal sign '=' or the curly bracket '{}'.
- Attribute values must be specified.
- Attribute values must be enclosed in quotes (single or double). Tip: a value that contains a double-quote can be surrounded by single-quotes, and vice versa.
- To enter the quote character surrounding the value in the value, enter it twice (e.g. "I don't think it's ""difficult"" to specify", or 'I don''t think it''s "difficult" to specify').
- {tt="textID"}
- text table reference to textID.
- {vs="fullPath" [format="vsFieldFormatString"]}
- text retrieval from a VirtualSpace field with the specified "name", with optional "format" string, specific to the data type of the VirtualSpace field.
- {connector="fullPath" [attr1=value1 ...customAttrValuePairs... attrN=valueN]}
- text retrieval from a Connector with the "fullPath" name. NOT IMPLEMENTED: refused by the parser ("Unknown tag: connector") until a connector tag exists (register entry IIZI-KSTRING-CONNECTOR-TAG-ABSENT).
SVG
The following tags are supported:
- Animation elements:
animate, animateColor, animateMotion, animateTransform, discard, mpath, set - Basic shapes:
circle, ellipse, line, polygon, polyline, rect - Container elements:
a, defs, g, marker, mask, missing-glyph, pattern, svg, switch, symbol, unknown - Descriptive elements:
desc, metadata, title - Filter primitive elements:
feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feFuncA, feFuncB, feFuncG, feFuncR,feGaussianBlur, feImage, feMerge, feMergeNode, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence - Font elements:
font, font-face, font-face-format, font-face-name, font-face-src, font-face-uri, hkern, vkern - Gradient elements:
linearGradient, meshgradient, radialGradient, stop - Graphics elements:
circle, ellipse, image, line, mesh, path, polygon, polyline, rect, text, use - Graphics referencing elements:
audio, iframe (ILLEGAL), image, mesh, use, video - HTML elements:
audio, canvas, iframe (ILLEGAL), video - Light source elements:
feDistantLight, fePointLight, feSpotLight - Never-rendered elements:
clipPath, defs, hatch, linearGradient, marker, mask, meshgradient, metadata, pattern, radialGradient, script (ILLEGAL), style, symbol, title - Paint server elements:
hatch, linearGradient, meshgradient, pattern, radialGradient, solidcolor - Renderable elements:
a, audio, canvas, circle, ellipse, foreignObject, g, iframe (ILLEGAL), image, line, mesh, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tspan, unknown, use, video - Shape elements:
circle, ellipse, line, mesh, path, polygon, polyline, rect - Structural elements:
defs, g, svg, symbol, use - Text content elements:
altGlyph, altGlyphDef, altGlyphItem, glyph, glyphRef, textPath, text, tref, tspan - Text content child elements:
altGlyph, textPath, tref, tspan - Uncategorized elements:
clipPath, color-profile, cursor, filter, foreignObject, hatchpath, meshpatch, meshrow, script (ILLEGAL), style, view
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of KString: what its parser admitted, and therefore what the client may be handed.static enumThe type of string.Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionKString(KString.Type type, String inputString) Creates the parsed KString where it is assumed the string can contain tags.KString(KString.Type type, String inputString, boolean usesTagProcessing) Creates the parsed KString.Method Summary
Modifier and TypeMethodDescriptionstatic voidappendToTransaction(PropMgr propertyManager, SendTransaction trans, KString ks, String wireString) Appends a KString to a transaction: the one wire form of every property that carries a KString (KStringProp, the tooltip and the badge).clone()Clones this KString.intCompares two KStrings with the raw format in their respective native format.static KStringConstructs a KString from an Element.static KStringcreateKStringForEditor(String inputString, boolean usesTagProcessing) Special creator for HTML-edited text in the Editor.static KStringcreateKStringForEditor(String inputString, boolean usesTagProcessing, boolean trusted) Special creator for HTML-edited text in the Editor, of the classical or the trusted kind.voiddispose()Disposes of the KString, needed in the Editor when references are used.booleanChecks for equality between two KStrings, including reference refresh counter checking and potential original source string.booleanChecks for pure equality between two KStrings, excluding reference refresh counter checking but including potential original source string.format(LocaleInfo localeInfo, Object... params) Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.format(IKStringInfoProvider provider, LocaleInfo localeInfo, Object... params) Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.format(IKStringInfoProvider provider, ILocaleString localeString, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.format(IKStringInfoProvider provider, Object... params) Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.format(IKStringInfoProvider provider, Locale locale, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.format(ILocaleString localeString, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(LocaleInfo localeInfo, Object... params) Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(IKStringInfoProvider provider, LocaleInfo localeInfo, Object... params) Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(IKStringInfoProvider provider, ILocaleString localeString, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(IKStringInfoProvider provider, Object... params) Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(IKStringInfoProvider provider, Locale locale, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(ILocaleString localeString, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(Object... params) Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.formatPLAIN(Locale locale, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.getDirectReferencedTargetSet(IGProp<?> owner) Gets the direct references of this property to others.getHTMLString(IKStringInfoProvider provider) Gets the string formatted in HTML.getKind()Gets the kind of KString: what its parser admitted.getPLAINString(TextTable textTableBase, String languageCode) Resolves the string that may contain tags to a text table.getPLAINString(IKStringInfoProvider provider) Gets the string formatted in HTML.Gets the "raw" string formatted in the "native" type, i.e.Gets the "raw" HTML debug-formatted string.Gets the "raw" HTML formatted string.Gets the "raw" HTML formatted string, with special formatting as required by the Rich Text Editor.Gets the "raw" HTML formatted string, with special formatting as required by the Rich Text Editor.Gets the "raw" PLAIN formatted string.Gets the "raw" PLAIN formatted string.Gets the "raw" string formatted in the "native" type, i.e.Returns the raw unparsed HTML string if this is the trusted unparsed kind (seenewTrustedUnparsedHTMLKString(String)).Gets the source of the KString.KStringTag<?> getTag(int position, boolean doIncludeStartPos) Gets the tag at specified position in string.KStringTag<?>[]getTags()Gets the array of tags for this string.KStringTag<?>[]Gets an independent copy of the tags of this string: a new array of cloned tag objects, so that writing through them leaves this KString untouched.getType()Gets the type of KString.inthashCode()The hash code.booleanChecks for the presence of image content modifiable tags: IMG.booleanChecks for the presence of content modifiable tags: A, IMG, IZ for HTML, or the reference tags in PLAIN format.booleanhasTags()Checks for presence of tags in the text in its original form (HTML or PLAIN).booleanChecks for the presence of content modifiable text table reference tags.booleanisEmpty()Checks if the string is empty, i.e.booleanisEmptyBlankResolved(boolean checkBlank, IKStringInfoProvider provider) Checks if the resolved KString of the current type would be an empty or blank string.booleanisHTML()Check if it's an HTML string originally.booleanisPLAIN()Check if it's an PLAIN string originally.booleanisRefreshRequired(RefreshEvent event) Returns whether the KString needs a refresh for the specified refresh type.final booleanChecks if this KString is of a trusted kind, parsed or unparsed.static PlainKStringnewPlainKString(String inputString) Creates a new PlainKString where it is assumed the string doesn't use tags.static KStringnewRawUnparsedHTMLKString(String rawUnparsedString) Deprecated.static KStringnewTrustedHTMLKString(String html, boolean usesTagProcessing) Creates a new parsed HTML KString of the trusted kind (KString.Kind.TRUSTED): HTML the application vouches for.static KStringnewTrustedUnparsedHTMLKString(String rawUnparsedString) Creates a new HTML KString of the trusted unparsed kind (KString.Kind.TRUSTED_UNPARSED): a whole page of generated markup the application vouches for, passed to the client exactly as it is.static KStringreadFromTransaction(PropMgr propertyManager, ReadTransaction trans, KString.Type type, boolean usesTagProcessing) Reads a KString from a transaction: the counterpart ofappendToTransaction(PropMgr,SendTransaction,KString,String).Formats to a Debug String.voidFills in the serialize information for this KString contents in an Element, so that it can be recreated when the XML is loaded in KStringProp.Gets a PlainKString from this KString instance.toString()Formats to a String.booleanChecks if this string uses the original value (HTML tags are always validated though).booleanChecks if this string will lose formatting when translated to PLAIN.
Field Details
EMPTY
The empty string: empty PLAIN.DEFAULT
The default string: empty HTML.MAX_WIRE_LENGTH
public static final int MAX_WIRE_LENGTHThe longest KString a transaction may carry, in characters (4 Mi). The parser itself has no limit - it is iterative and linear - so the bound sits where untrusted input arrives: a longer string is refused byreadFromTransaction(PropMgr,ReadTransaction,Type,boolean).- See Also:
Constructor Details
KString
Creates the parsed KString where it is assumed the string can contain tags.- Parameters:
type- The type of string, PLAIN or HTML.inputString- The input string in correct format.- Throws:
KStringException- If type or inputString is null, for parsing or reference errors.
KString
public KString(KString.Type type, String inputString, boolean usesTagProcessing) throws KStringException Creates the parsed KString.The parameter
usesTagProcessingis used to control parsing of the string to look-up potential references to e.g. the iiziApp. An HTML string will be parsed for security reasons in all cases.- Parameters:
type- The type of string, PLAIN or HTML.inputString- The input string in correct format.usesTagProcessing- Flag indicating special IIZI tags might be included.- Throws:
KStringException- For string errors.KStringParseException- For parsing errors.IllegalArgumentException- If type or inputString is null.
Method Details
newPlainKString
Creates a new PlainKString where it is assumed the string doesn't use tags.- Parameters:
inputString- The input string.- Returns:
- A new instance of the PlainKString.
newTrustedHTMLKString
public static KString newTrustedHTMLKString(String html, boolean usesTagProcessing) throws KStringException Creates a new parsed HTML KString of the trusted kind (KString.Kind.TRUSTED): HTML the application vouches for. The parser accepts SCRIPT, IFRAME, STYLE and FOREIGNOBJECT and inspects no attribute value; the attribute NAME rule is the classical one (only "onclick" and "ondblclick" of the event attributes). References inside it are resolved, refactoring follows renames,format(Object...)works and verification reports broken references, as for the classical kind.Never put text that did not come from the application's author into a trusted KString: escape it first (see
HTMLUtilities.escapeString(String,boolean)) or parse it as a classical KString and insert itsgetRawHTMLString().- Parameters:
html- The HTML string.usesTagProcessing- Flag indicating special IIZI tags might be included.- Returns:
- The trusted KString of HTML type.
- Throws:
KStringException- For string errors.KStringParseException- For parsing errors.IllegalArgumentException- If html is null.
newTrustedUnparsedHTMLKString
Creates a new HTML KString of the trusted unparsed kind (KString.Kind.TRUSTED_UNPARSED): a whole page of generated markup the application vouches for, passed to the client exactly as it is.Its limits: it is never parsed, so it has no tags, no references are resolved (IZ, A type="vs"/"panel", IMG with an application source stay as written), refactoring does not follow renames,
format(Object...)is not available, verification cannot report anything, andequals(Object)compares the source text. It is born disposed. It is the performance path for large generated HTML (a parse costs about 0.4 ms for a 25 KB page and 16 ms for a 180 KB one; this factory costs a reference assignment).- Parameters:
rawUnparsedString- The raw unparsed HTML string.- Returns:
- The trusted unparsed KString of HTML type.
- Throws:
NullPointerException- If the rawUnparsedString is null.
newRawUnparsedHTMLKString
Deprecated.The raw unparsed KString is the trusted unparsed kind: usenewTrustedUnparsedHTMLKString(String), which says what it is.Creates a new HTML unparsed raw HTML string.- Parameters:
rawUnparsedString- The raw unparsed HTML string.- Returns:
- The KString of HTML type, of the trusted unparsed kind.
createKString
Constructs a KString from an Element. The kind is read from the "trusted" attribute: absent or "false" is the classical kind, "true" the trusted kind, "unparsed" the trusted unparsed kind (whose "value" is the source).- Parameters:
e- The Element.- Returns:
- A new KString, null if the "value" attribute is not present.
- Throws:
KStringException- For string errors.KStringParseException- For parsing errors.
toElement
Fills in the serialize information for this KString contents in an Element, so that it can be recreated when the XML is loaded in KStringProp. The classical kind writes "value", "type" and "tags"; the trusted kinds add the "trusted" attribute, so a file written by a classical value is what it always was.- Parameters:
e- The XML element to initialize attributes in.
createKStringForEditor
public static KString createKStringForEditor(String inputString, boolean usesTagProcessing) throws KStringException Special creator for HTML-edited text in the Editor. INPUT tags are used to insert text references, and this tag is converted with this method.- Parameters:
inputString- The input string in correct format.usesTagProcessing- Flag indicating special IIZI tags might be included.- Returns:
- The KString edited in the RichTextEditor.
- Throws:
KStringException- For string errors.KStringParseException- For parsing errors.
createKStringForEditor
public static KString createKStringForEditor(String inputString, boolean usesTagProcessing, boolean trusted) throws KStringException Special creator for HTML-edited text in the Editor, of the classical or the trusted kind. INPUT tags are used to insert text references, and this tag is converted with this method.- Parameters:
inputString- The input string in correct format.usesTagProcessing- Flag indicating special IIZI tags might be included.trusted- true for the trusted kind (the property being edited holds one), false for classical.- Returns:
- The KString edited in the RichTextEditor.
- Throws:
KStringException- For string errors.KStringParseException- For parsing errors.
getSource
Gets the source of the KString.- Returns:
- The source string that constructed the KString, or null if not available (it is only non-null in the Designer).
toPlainKString
Gets a PlainKString from this KString instance. This will succeed if the Type is PLAIN. If this already is a PlainKString instance, the same instance (this) is returned.- Returns:
- A new PlainKString.
- Throws:
KStringException- If this is not possible, i.e. if it's an HTML Type.
dispose
public void dispose()Disposes of the KString, needed in the Editor when references are used.getRawUnparsedHTMLString
Returns the raw unparsed HTML string if this is the trusted unparsed kind (seenewTrustedUnparsedHTMLKString(String)).- Returns:
- The raw unparsed HTML string, or
nullif this is a parsed KString of any kind.
getType
getKind
Gets the kind of KString: what its parser admitted. The kind is the class, not a field; the trusted kinds override this method.- Returns:
KString.Kind.CLASSICALfor every KString created by a constructor of this class.
isTrusted
public final boolean isTrusted()Checks if this KString is of a trusted kind, parsed or unparsed.- Returns:
- true for
KString.Kind.TRUSTEDandKString.Kind.TRUSTED_UNPARSED, false for the classical kind.
appendToTransaction
public static void appendToTransaction(PropMgr propertyManager, SendTransaction trans, KString ks, String wireString) Appends a KString to a transaction: the one wire form of every property that carries a KString (KStringProp, the tooltip and the badge). To a JavaScript client the string alone is sent, as always. To a Java peer (PropMgr.hasJavaScriptClient()false) one flags byte precedes the string and carries the kind (bit 0 trusted, bit 1 unparsed), so that a trusted KString stays trusted across a Java-to-Java link.- Parameters:
propertyManager- The property manager of the link.trans- The transaction to append to.ks- The KString whose kind is carried, or null for none (the classical flags).wireString- The string to send: the resolved HTML or PLAIN text, or the unparsed source.
readFromTransaction
public static KString readFromTransaction(PropMgr propertyManager, ReadTransaction trans, KString.Type type, boolean usesTagProcessing) throws KStringException Reads a KString from a transaction: the counterpart ofappendToTransaction(PropMgr,SendTransaction,KString,String). From a JavaScript client the string alone is read and the result is always of the classical kind: a client can craft any byte, so no flag is honoured from it. From a Java peer the flags byte is read first and decides the kind.- Parameters:
propertyManager- The property manager of the link.trans- The transaction to read from.type- The type to create, PLAIN or HTML.usesTagProcessing- Flag indicating special IIZI tags might be included.- Returns:
- The KString of the kind the peer sent (classical from a JavaScript client).
- Throws:
KStringException- For a string longer thanMAX_WIRE_LENGTH, for invalid flags (a bit outside the two, "unparsed" without "trusted", a trusted flag with the PLAIN type), and for string or parsing errors.KStringParseException- For parsing errors.
isHTML
public boolean isHTML()Check if it's an HTML string originally.- Returns:
- true if this KString is of HTML type.
isPLAIN
public boolean isPLAIN()Check if it's an PLAIN string originally.- Returns:
- true if this KString is of PLAIN type.
isEmpty
public boolean isEmpty()Checks if the string is empty, i.e. contains no characters and no tags.- Returns:
- true if this KString would resolve to an empty string.
isEmptyBlankResolved
Checks if the resolved KString of the current type would be an empty or blank string. References to text files, etc, is handled.- Parameters:
checkBlank- Flag to useString.isBlank()iftrue, otherwiseString.isEmpty()whenfalse. A blank string is either empty or contains only whitespace code points.provider- The KString information provider.- Returns:
- The empty string flag.
- Throws:
NullPointerException- If the KString informationproviderisnull.
usesTagProcessing
public boolean usesTagProcessing()Checks if this string uses the original value (HTML tags are always validated though). For PLAIN text, this means no transformation whatsoever from the original input string.- Returns:
- Flag indicating if tag-processing is enabled.
hasTags
public boolean hasTags()Checks for presence of tags in the text in its original form (HTML or PLAIN). The option not to parse the string only applies for PLAIN text (whenusesTagProcessing()returns false, this method always returns false).- Returns:
- Flag indicating presence of tags.
hasReferenceTags
public boolean hasReferenceTags()Checks for the presence of content modifiable tags: A, IMG, IZ for HTML, or the reference tags in PLAIN format.- Returns:
- true if there are any tags with references.
hasImageReferenceTags
public boolean hasImageReferenceTags()Checks for the presence of image content modifiable tags: IMG.- Returns:
- true if there are any tags with references to a text table.
hasTextTableReferenceTags
public boolean hasTextTableReferenceTags()Checks for the presence of content modifiable text table reference tags.This method is typically used to check if updates is required to the resolved KString HTML or PLAIN string in case of language change.
- Returns:
- true if there are any tags with references to a text table.
willLoseFormatting
public boolean willLoseFormatting()Checks if this string will lose formatting when translated to PLAIN. Note that translating PLAIN to HTML never loses formatting.- Returns:
- true if the string will lose formatted if converted from HTML to PLAIN, false if KString type is PLAIN or there are no tags that cannot be represented in a PLAIN KString.
getRawString
Gets the "raw" string formatted in the "native" type, i.e. HTML or PLAIN.- Returns:
- The raw native-formatted string.
getRawDebugString
Gets the "raw" string formatted in the "native" type, i.e. HTML or PLAIN.- Returns:
- The raw native-formatted string, where HTML character entities (in case of a HTML Ktring type) are surrounded by curly brackets '{}' and tags with brackets '[]'. Tags are surrounded with brackets in either HTML or PLAIN format.
getRawPLAINString
Gets the "raw" PLAIN formatted string. This method is used by the designer to get the editable contents. It can also be used to convert a KString from HTML to PLAIN, but quite a lot of information is then lost (e.g. all formatting).- Returns:
- The PLAIN formatted string.
getRawPLAINDebugString
Gets the "raw" PLAIN formatted string.- Returns:
- The PLAIN formatted string with tags where located, enclosed in brackets '[]'.
getRawHTMLString
Gets the "raw" HTML formatted string. This method is used by the designer to get the editable contents. It can also be used to convert a KString from PLAIN to HTML.- Returns:
- The HTML formatted string.
getRawHTMLDebugString
Gets the "raw" HTML debug-formatted string.- Returns:
- The HTML formatted string with tags where located, enclosed in brackets '[]', and HTML character identities with curly brackets '{}', except inside tags.
getRawHTMLStringForEditor
Gets the "raw" HTML formatted string, with special formatting as required by the Rich Text Editor.- Returns:
- The HTML formatted string for Rich Text Editor.
getRawHTMLStringForEditor
Gets the "raw" HTML formatted string, with special formatting as required by the Rich Text Editor.- Parameters:
provider- The information provider or null for none.- Returns:
- The HTML formatted string for Rich Text Editor.
getPLAINString
Gets the string formatted in HTML.- Parameters:
provider- The information provider ornullfor none.- Returns:
- The HTML formatted string.
getPLAINString
Resolves the string that may contain tags to a text table. No other tag is allowed, and the string MUST be of PLAIN type.The text entries for a specific language code is first looked up, then it falls back on the derived tables in order.
- Parameters:
textTableBase- The base text table to use,nullwill result in aNullPointerException.languageCode- The language code supported by the app, null for default.- Returns:
- The localized-resolved string.
- Throws:
IllegalArgumentException- If the KString is not PLAIN or contains tags other than Text Table tags.NullPointerException- If the KString contains text table tags and thetextTableisnull
getHTMLString
Gets the string formatted in HTML.- Parameters:
provider- The information provider ornullfor none.- Returns:
- The HTML formatted string.
isRefreshRequired
Returns whether the KString needs a refresh for the specified refresh type.- Parameters:
event- The refresh event.- Returns:
- true for refresh needed, false otherwise.
equals
Checks for equality between two KStrings, including reference refresh counter checking and potential original source string. If the source strings are not available, but only the raw data, those strings are compared for equality.hashCode
equalsOmitReferenceRefreshCheck
Checks for pure equality between two KStrings, excluding reference refresh counter checking but including potential original source string.This method is used when comparing values for e.g. save file.
- Parameters:
ks- Another KString, perhaps null.- Returns:
- true if equal, false otherwise.
compareTo
Compares two KStrings with the raw format in their respective native format.- Specified by:
compareToin interfaceComparable<KString>- Parameters:
ks- Another KString.- Returns:
- The string comparison value, not taking into account the type of KString nor if tag processing is used, i.e. the comparison is done with the 'source' if both has a source representation (e.g. in the Editor or coded for it using the KString constructor that includes 'source'), otherwise the comparison is done using the result of
getRawString()for both KString's. Equal strings of different kinds order classical, trusted, trusted unparsed.
clone
getTags
Gets the array of tags for this string. The ARRAY is a copy; the tag objects in it are the KString's own, so a write through one of them (setAttribute,setReference) changes this KString - that is the route the refactoring machinery uses. For an independent copy usegetTagsCopy().- Returns:
- The array of tags for this string, null for none.
getTagsCopy
Gets an independent copy of the tags of this string: a new array of cloned tag objects, so that writing through them leaves this KString untouched.- Returns:
- The copied tags, null for none.
getTag
Gets the tag at specified position in string.- Parameters:
position- Position in String.doIncludeStartPos- Include starting position or not.- Returns:
- The tag, or null if not found.
toString
Formats to a String.toDebugString
Formats to a Debug String.- Returns:
- A string as
KString[<i>type</i>,tags=<i>boolean</i>] = "<i>rawString</i>"wheretypeisHTMLorplain,tagsindicates if tag support is enabled or not andrawStringis the raw string representation of the KString data.The raw native-formatted string, where HTML character entities (in case of a HTML KString type) are surrounded by curly brackets '{}' and tags with brackets '[]'. Tags are surrounded with brackets in either HTML or PLAIN format.
format
Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.In a PLAIN KString created WITH tag processing the tag parser claims a single opening brace, so the placeholder is written with that brace doubled:
{{}and{{n}(the parser keeps one brace and this method then sees{}/{n}); a bare{}is refused ("Missing tag name"). HTML strings and PLAIN strings without tag processing take{}as written.The locale and potential
IKStringInfoProvider provideris looked up from the current thread if required.- Parameters:
params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The locale is looked up from the current thread if required.
- Parameters:
provider- The information provider ornullto look it up for the current session.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.- Parameters:
locale- The Locale, ornullto look it up for the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
public KString format(IKStringInfoProvider provider, Locale locale, Object... params) throws KStringException Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.- Parameters:
provider- The information provider ornullto look it up for the current session.locale- The Locale, ornullto look it up for the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The
IKStringInfoProvideris looked up from the current session.- Parameters:
localeString- The locale string instance, ornullfor current session.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
public KString format(IKStringInfoProvider provider, ILocaleString localeString, Object... params) throws KStringException Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.- Parameters:
provider- The information provider ornullto look it up for the current session.localeString- The locale string instance, ornullfor current session.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The
IKStringInfoProvideris looked up from the current session.- Parameters:
localeInfo- The Locale information, ornullto look it up from the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
format
public KString format(IKStringInfoProvider provider, LocaleInfo localeInfo, Object... params) throws KStringException Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to HTML or PLAIN KString's, depending on this KString instance type.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The
IKStringInfoProvideris looked up from the current session.- Parameters:
provider- The information provider ornullfor none.localeInfo- The Locale information, ornullto look it up from the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted KString of the same
KString.Typeas this instance. The return value might bethisKString instance if there are no parameters available or if there is no parameter reference. - Throws:
KStringException- For exceptions formatting a HTML string.- See Also:
formatPLAIN
Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.In a PLAIN KString created WITH tag processing the tag parser claims a single opening brace, so the placeholder is written with that brace doubled:
{{}and{{n}(the parser keeps one brace and this method then sees{}/{n}); a bare{}is refused ("Missing tag name"). HTML strings and PLAIN strings without tag processing take{}as written.The locale and potential
IKStringInfoProvider provideris looked up from the current thread if required.- Parameters:
params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
Formats the HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link Utilities#toString()}enable e.g. deep-to-String of e.g. Exceptions, Arrays, etc. Parameters references e.g. using%swill not receive this "toString" conversion (unless they target the sameparam_index.Parameters referenced by
{[param_index]}that are KString types areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The locale is looked up from the current thread if required.
- Parameters:
provider- The information provider ornullto look it up for the current session.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link toString()}, except when the parameters areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.- Parameters:
locale- The Locale, ornullto look it up for the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link toString()}, except when the parameters areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.- Parameters:
provider- The information provider ornullto look it up for the current session.locale- The Locale, ornullto look it up for the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link toString()}, except when the parameters areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The
IKStringInfoProvider providerparameter is looked up from the current session.- Parameters:
localeString- The locale string instance, ornullfor current session.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
public KString formatPLAIN(IKStringInfoProvider provider, ILocaleString localeString, Object... params) Formats a HTML or PLAIN KString using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link toString()}, except when the parameters areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.- Parameters:
provider- The information provider ornullto look it up for the current session.localeString- The locale string instance, ornullfor current session.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link toString()}, except when the parameters areKString's in which case they are converted to PLAIN KString's.The formatting string replaces
{}with%sand{param_index}with%param_index$s.The
IKStringInfoProvideris looked up from the current session.- Parameters:
localeInfo- The Locale information, ornullto look it up from the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
formatPLAIN
Formats a String using curly brackets{}as parameter or{param_index}parameter whereparam_indexis an optional one-based index value, AND/OR the JavaString.format(Locale, String, Object...)method using parameters in the form of%[flags][width]conversionor%[argument_index$][flags][width]conversion.Parameters referenced by
{[param_index]}are convertedtoString()using{@link toString()}, except when the parameters areKString's in which case they are converted to PLAIN KString's.The
IKStringInfoProvider providerparameter is looked up from the current session.- Parameters:
provider- The information provider ornullfor none.localeInfo- The Locale information, ornullto look it up from the current thread if needed.params- The parameters. Anyparamselements of KString type will be converted to a resolvedKString.Type.PLAINString using the method{@link #getPLAINString(IKStringInfoProvider)}.- Returns:
- The formatted PLAIN KString.
- See Also:
getDirectReferencedTargetSet
Gets the direct references of this property to others.- Parameters:
owner- The owner property of the KString, used for e.g. reference look-up's.- Returns:
- The references list instance
referencesif non-null, or a new filled in instance. Returnsnullif no references are found and thereferencesparameter also wasnull.
newTrustedUnparsedHTMLKString(String), which says what it is.