terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.eval.converters
Class ToJava

java.lang.Object
  extended by com.codemesh.terp.eval.converters.ToJava
All Implemented Interfaces:
Converter<JavaExecutor>

public class ToJava
extends java.lang.Object
implements Converter<JavaExecutor>

A converter for Java executors. This converter is registered with the terp runtime under the ^java() alias.


Field Summary
protected static ToFile TO_FILE
           
protected static ToVersion TO_VERSION
           
 
Constructor Summary
ToJava()
           
 
Method Summary
 JavaExecutor fromFile(java.io.File java)
           
 JavaExecutor fromMap(JavaExecutor result, java.util.Map map)
           
 JavaExecutor fromMap(java.util.Map map)
           
 JavaExecutor fromObject(java.lang.Object obj, TerpContext ctx)
          Converts the given object into an object of the target type.
 JavaExecutor fromString(java.lang.String java)
           
 JavaExecutor fromVersion(Version vers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_VERSION

protected static final ToVersion TO_VERSION

TO_FILE

protected static final ToFile TO_FILE
Constructor Detail

ToJava

public ToJava()
Method Detail

fromObject

public JavaExecutor fromObject(java.lang.Object obj,
                               TerpContext ctx)
Converts the given object into an object of the target type. Conversions can be implemented in any way that makes sense. Normally, converters will return null for null, but some converters may choose to interpret null as an indicator to return a default-initialized target object. An example of this type of conversion is the ShellExecutor. null simply indicates that no preference overrides of any kind have been provided.

Specified by:
fromObject in interface Converter<JavaExecutor>
Parameters:
obj - the source object.
ctx - the context in which the conversion takes place.
Returns:
an instance of the target type or null.

fromString

public JavaExecutor fromString(java.lang.String java)

fromFile

public JavaExecutor fromFile(java.io.File java)

fromVersion

public JavaExecutor fromVersion(Version vers)

fromMap

public JavaExecutor fromMap(java.util.Map map)

fromMap

public JavaExecutor fromMap(JavaExecutor result,
                            java.util.Map map)

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.