com.threerings.jpkg.ant.dpkg.scripts
Class TemplateScript
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.threerings.antidote.field.BaseComponent
com.threerings.antidote.field.BaseField
com.threerings.jpkg.ant.dpkg.scripts.BaseTemplateScript
com.threerings.jpkg.ant.dpkg.scripts.TemplateScript
- All Implemented Interfaces:
- Field, ReferenceField, RequiresValidation, PackageScript, ValidationScript, VelocityTemplate, Cloneable
- Direct Known Subclasses:
- AbstractTypeScript, HelloWorld
public abstract class TemplateScript
- extends BaseTemplateScript
A simple implementation of BaseTemplateScript
which provides helpers to populate the
velocity context and inserts the DpkgData
object into the context by default.
Methods inherited from class com.threerings.antidote.field.BaseComponent |
appendViolation, appendViolationList, getReferencedField, isReference, registerField, reportConflictingProperties, reportUnsetDependentFields, reportUnsetDependentProperties, reportUnsetField, setReference, validate, validateChildFields, validateChildFields, validateField, validateOptionalProperties, validateProperties, validateProperties |
Methods inherited from class org.apache.tools.ant.Task |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
DPKG_DATA_KEY
protected static final String DPKG_DATA_KEY
- The default key name to use when adding the
DpkgData
object to the context.
- See Also:
- Constant Field Values
TemplateScript
public TemplateScript(MaintainerScript.Type type)
- Construct a
TemplateScript
with the single script type implemented.
TemplateScript
public TemplateScript(Set<MaintainerScript.Type> types)
- Construct a
TemplateScript
with a set of the script types implemented.
- See Also:
typeList(MaintainerScript.Type...)
typeList
public static Set<MaintainerScript.Type> typeList(MaintainerScript.Type... types)
- A static helper to pass a list of types to the constructor.
getTypes
public Set<MaintainerScript.Type> getTypes()
- Description copied from interface:
PackageScript
- Returns the
MaintainerScript.Type
objects implemented by this script.
getSource
public InputStream getSource(DpkgData data)
throws IOException
- Description copied from interface:
PackageScript
- Returns the script text source.
- Throws:
IOException
populateContext
public void populateContext(VelocityContext context)
- Description copied from interface:
VelocityTemplate
- Provides the template a
VelocityContext
to populate with e.g. key/value substitutions.
addSubstitution
protected void addSubstitution(String key,
Object value)
- Add a Velocity template substitution, converting the supplied key into the supplied value.
Copyright © 2007-2008 Three Rings Design, Inc.
All Rights Reserved. Released under a BSD license.