public class KMLBalloonTextDecoder extends BasicTextDecoder
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
entityCache
Keep a cache of entities that have been resolved so that we don't have to re-resolve them every time the decoded
text is requested.
|
protected KMLAbstractFeature |
feature
Feature to use as context for entity replacements.
|
protected boolean |
isUnresolved
True if there are entities in the balloon text which may refer to unresolved schema.
|
decodedText, lastUpdateTime, text
Constructor and Description |
---|
KMLBalloonTextDecoder(KMLAbstractFeature feature)
Create a decoder to generate balloon text for a feature.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
decode(java.lang.String textToDecode)
Perform entity substitution.
|
java.lang.String |
getDecodedText()
Get the balloon text after entity substitutions (for example, $[name], $[description], etc) have been made.
|
KMLAbstractFeature |
getFeature()
Get the feature used as context for resolving entity references.
|
protected java.lang.String |
getGeDirectionsText()
Get the text used to replace the $[geDirections] entity.
|
protected java.lang.String |
resolveEntityReference(java.lang.String pattern)
Resolve an entity reference.
|
void |
setText(java.lang.String input)
Set the input text which the decoder will process.
|
getLastUpdateTime
protected java.util.Map<java.lang.String,java.lang.String> entityCache
protected KMLAbstractFeature feature
protected boolean isUnresolved
public KMLBalloonTextDecoder(KMLAbstractFeature feature)
feature
- Feature that is the context of entity replacements.protected java.lang.String decode(java.lang.String textToDecode)
decode
in class BasicTextDecoder
textToDecode
- The text to decode.public java.lang.String getDecodedText()
getDecodedText
in interface TextDecoder
getDecodedText
in class BasicTextDecoder
public KMLAbstractFeature getFeature()
protected java.lang.String getGeDirectionsText()
protected java.lang.String resolveEntityReference(java.lang.String pattern)
FeatureField DataField DataField/displayName SchemaName/SchemaField SchemaName/SchemaField/displayNameSee the KML spec for details.
pattern
- Pattern of entity to resolve.public void setText(java.lang.String input)
setText
in interface TextDecoder
setText
in class BasicTextDecoder
input
- Text to decode.