com.threerings.jpkg.ant.dpkg.scripts.standard
Class AbstractTypeScript

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.threerings.antidote.field.BaseComponent
              extended by com.threerings.antidote.field.BaseField
                  extended by com.threerings.jpkg.ant.dpkg.scripts.BaseTemplateScript
                      extended by com.threerings.jpkg.ant.dpkg.scripts.TemplateScript
                          extended by com.threerings.jpkg.ant.dpkg.scripts.standard.AbstractTypeScript
All Implemented Interfaces:
Field, ReferenceField, RequiresValidation, PackageScript, ValidationScript, VelocityTemplate, Cloneable
Direct Known Subclasses:
PostInst, PostRm, PreInst, PreRm

public abstract class AbstractTypeScript
extends TemplateScript

An abstract TemplateScript for defining the script source from either a file or a single command listed as a string.


Field Summary
 
Fields inherited from class com.threerings.jpkg.ant.dpkg.scripts.TemplateScript
DPKG_DATA_KEY
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
AbstractTypeScript(MaintainerScript.Type type)
           
 
Method Summary
 boolean failOnError()
          Whether to report the failure of this script to the package system.
 InputStream getSource(DpkgData data)
          Returns the script text source.
 String getTemplateName()
          Returns the name of the template, as found in the classpath.
 void setCommand(String value)
          Ant setter field: the command line.
 void setFailonerror(String value)
          Ant setter field: failonerror.
 void setSource(String value)
          Ant setter field: the source file.
protected  void validateField()
          Give each subclass a chance to do field specific validation.
 
Methods inherited from class com.threerings.jpkg.ant.dpkg.scripts.TemplateScript
addSubstitution, getTypes, populateContext, typeList
 
Methods inherited from class com.threerings.jpkg.ant.dpkg.scripts.BaseTemplateScript
mergeTemplate
 
Methods inherited from class com.threerings.antidote.field.BaseField
execute, init, reconfigure, setRefid
 
Methods inherited from class com.threerings.antidote.field.BaseComponent
appendViolation, appendViolationList, getReferencedField, isReference, registerField, reportConflictingProperties, reportUnsetDependentFields, reportUnsetDependentProperties, reportUnsetField, setReference, validate, validateChildFields, validateChildFields, 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
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.antidote.field.ReferenceField
getReferencedField, isReference
 
Methods inherited from interface com.threerings.antidote.field.Field
getFieldName, getLocation
 
Methods inherited from interface com.threerings.antidote.RequiresValidation
validate
 
Methods inherited from interface com.threerings.jpkg.ant.dpkg.scripts.runner.PackageScript
getFriendlyName
 

Constructor Detail

AbstractTypeScript

public AbstractTypeScript(MaintainerScript.Type type)
Method Detail

getTemplateName

public String getTemplateName()
Description copied from interface: VelocityTemplate
Returns the name of the template, as found in the classpath.


getSource

public InputStream getSource(DpkgData data)
                      throws IOException
Description copied from interface: PackageScript
Returns the script text source.

Specified by:
getSource in interface PackageScript
Overrides:
getSource in class TemplateScript
Throws:
IOException

failOnError

public boolean failOnError()
Description copied from interface: PackageScript
Whether to report the failure of this script to the package system. If true, then a failure in this script will fail the package installation or removal.


setCommand

public void setCommand(String value)
Ant setter field: the command line.


setSource

public void setSource(String value)
Ant setter field: the source file.


setFailonerror

public void setFailonerror(String value)
Ant setter field: failonerror.


validateField

protected void validateField()
Description copied from class: BaseComponent
Give each subclass a chance to do field specific validation.

Specified by:
validateField in class BaseComponent


Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.