|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
com.codemesh.terp.ant.FileToBytes
public class FileToBytes
An ANT task that takes an arbitrary file(set) as input and converts it to a byte array in one of several supported languages. This task usually expects to receive a .class or .jar file as input, but it could be used for a set of files or for totally different file types as well. The generated byte array will be in a form that is compilable in the target language and can thereby be embedded in an application.
| Field Summary | |
|---|---|
static java.lang.String |
LANG_CPP
|
static java.lang.String |
LANG_CS
|
static java.lang.String |
LANG_JAVA
|
| Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
|---|
fileset |
| 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 | |
|---|---|
FileToBytes()
|
|
| Method Summary | |
|---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Adds a fileset to the maintained vector of filesets. |
void |
execute()
|
java.lang.String |
getEncoding()
Returns the encoding that is to be used for the generated file. |
java.lang.String |
getLanguage()
Returns the language for which the files are generated. |
java.lang.String |
getNamespace()
Returns the namespace that is used for .NET files. |
java.lang.String |
getPackage()
Returns the package name that is used for the bytes-holding type if the target language is "java". |
java.lang.String |
getPrefix()
Returns the filename prefix. |
void |
setDestDir(java.io.File destDir)
Sets the target directory into which the generated files are written. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding for the generated file. |
void |
setLanguage(java.lang.String language)
Sets the language in which the generated files are to be compilable. |
void |
setNamespace(java.lang.String namespace)
Sets the namespace that is used for .NET files. |
void |
setPackage(java.lang.String pack)
Sets the package name that is used for Java files. |
void |
setPrefix(java.lang.String prefix)
Sets an optional filename prefix for the generated file. |
void |
setTargetDir(java.io.File targetDir)
Sets the target directory into which the generated files are written. |
void |
toCpp(java.io.File baseDir,
java.lang.String file)
|
void |
toCs(java.io.File baseDir,
java.lang.String file)
|
void |
toJava(java.io.File baseDir,
java.lang.String file)
|
| Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
|---|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LANG_CPP
public static final java.lang.String LANG_CS
public static final java.lang.String LANG_JAVA
| Constructor Detail |
|---|
public FileToBytes()
| Method Detail |
|---|
public void addFileset(org.apache.tools.ant.types.FileSet set)
public void setEncoding(java.lang.String encoding)
encoding - the encoding to use.public java.lang.String getEncoding()
public void setDestDir(java.io.File destDir)
destDir - public void setTargetDir(java.io.File targetDir)
public void setLanguage(java.lang.String language)
public java.lang.String getLanguage()
public void setPackage(java.lang.String pack)
pack - the package in which the bytes-holding type is generated.public java.lang.String getPackage()
public void setNamespace(java.lang.String namespace)
namespace - public java.lang.String getNamespace()
public void setPrefix(java.lang.String prefix)
public java.lang.String getPrefix()
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException
public void toCpp(java.io.File baseDir,
java.lang.String file)
public void toCs(java.io.File baseDir,
java.lang.String file)
public void toJava(java.io.File baseDir,
java.lang.String file)
|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||