org.webmacro.engine
Class StringMacroAdapter

java.lang.Object
  |
  +--org.webmacro.engine.StringMacroAdapter
All Implemented Interfaces:
Macro, Visitable

public final class StringMacroAdapter
extends java.lang.Object
implements Macro, Visitable

Looks like a Macro, but really it's a String.


Constructor Summary
StringMacroAdapter(java.lang.String wrapMe)
           
 
Method Summary
 void accept(TemplateVisitor v)
           
 java.lang.Object evaluate(Context context)
          Returns the wrapped object, context is ignored.
 java.lang.String toString()
           
 void write(FastWriter out, Context context)
          Just calls toString() and writes that, context is ignored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringMacroAdapter

public StringMacroAdapter(java.lang.String wrapMe)
Method Detail

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

accept

public void accept(TemplateVisitor v)
Specified by:
accept in interface Visitable

evaluate

public final java.lang.Object evaluate(Context context)
Returns the wrapped object, context is ignored.
Specified by:
evaluate in interface Macro
Following copied from interface: org.webmacro.Macro
Throws:
PropertyException - if required data was missing from context

write

public final void write(FastWriter out,
                        Context context)
                 throws java.io.IOException
Just calls toString() and writes that, context is ignored.
Specified by:
write in interface Macro
Following copied from interface: org.webmacro.Macro
Throws:
PropertyException - if required data was missing from context
java.io.IOException - if we could not successfully write to out