org.webmacro.engine
Class MacroAdapter
java.lang.Object
|
+--org.webmacro.engine.MacroAdapter
- All Implemented Interfaces:
- Macro, Visitable
- public final class MacroAdapter
- extends java.lang.Object
- implements Macro, Visitable
Looks like a Macro, but really it's not. Wrap any object as
a Macro via the createMacro method. You can use this when you
have to return a Macro, but what you have is something else.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
toString
public final java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
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 contextjava.io.IOException
- if we could not successfully write to out
accept
public void accept(TemplateVisitor v)
- Specified by:
accept
in interface Visitable
createMacro
public static final Macro createMacro(java.lang.Object wrapMe)
throws BuildException
- If wrapMe is not a Macro, wrap it and return it. If it
is a Macro already, just return it.