Drag[en]gine Script Module DragonScript Script API  1.0
STDVariableResolver Class Reference

Replace variables with resolved content. More...

Inheritance diagram for STDVariableResolver:
DefaultSTDNodeVisitor STDNodeVisitor

Public Member Functions

StyledTextDefinition getDefinition ()
 Styled text definition to add the visited content to. More...
 
bool isVariableNameCharacterFirst (byte character)
 Character is a variable name character. More...
 
bool isVariableNameCharacterFollowing (byte character)
 Character is a variable name character. More...
 
STDVariableResolver new (StyledTextDefinition definition)
 Create converter. More...
 
String resolveVariable (String variableName)
 Resolve variable returning the value to set in place of the variable. More...
 
void visitImage (STDNImage node)
 Visit image node. More...
 
void visitNode (STDNode node)
 Visit node. More...
 
void visitText (STDNText node)
 Visit text node. More...
 
- Public Member Functions inherited from DefaultSTDNodeVisitor
DefaultSTDNodeVisitor new ()
 Create default styled text definition node visitor. More...
 
void visitImage (STDNImage node)
 Visit image node. More...
 
void visitNode (STDNode node)
 Visit node. More...
 
void visitText (STDNText node)
 Visit text node. More...
 

Detailed Description

Replace variables with resolved content.

Subclass and implement the resolvVariable method to return the requested values. The visited content is added to a new styled text definition to keep the original intact.

Member Function Documentation

§ getDefinition()

StyledTextDefinition getDefinition ( )

Styled text definition to add the visited content to.

§ isVariableNameCharacterFirst()

bool isVariableNameCharacterFirst ( byte  character)

Character is a variable name character.

§ isVariableNameCharacterFollowing()

bool isVariableNameCharacterFollowing ( byte  character)

Character is a variable name character.

§ new()

STDVariableResolver new ( StyledTextDefinition  definition)

Create converter.

§ resolveVariable()

String resolveVariable ( String  variableName)

Resolve variable returning the value to set in place of the variable.

The default implementation returns the variable name in curly brackets. This can be used as error fallback.

§ visitImage()

void visitImage ( STDNImage  node)

Visit image node.

Implements STDNodeVisitor.

§ visitNode()

void visitNode ( STDNode  node)

Visit node.

Implements STDNodeVisitor.

§ visitText()

void visitText ( STDNText  node)

Visit text node.

Implements STDNodeVisitor.


The documentation for this class was generated from the following file: