org.codelabor.system.xplatform.ant
Class Xml2bin

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.codelabor.system.xplatform.ant.Xml2bin
All Implemented Interfaces:
Cloneable

public class Xml2bin
extends org.apache.tools.ant.Task

The xml2bin task compile XPLATFORM .xfdl files. This task will work on Windows using the external xml2bin executable (provided by TOBESOFT).

Author:
Shin Sang-jae

Field Summary
protected  File destDir
          Destination directory
protected  String encoding
          Charater encoding
protected  String executable
          xml2bin.exe executable file fully qualified path.
protected  int exitValue
          Exit value
protected  boolean failonerror
          Fail on error flag.
protected  List<org.apache.tools.ant.types.FileSet> fileSets
          File sets
protected  File iniFile
          xml2bin .ini file.
protected  String logFile
          Log file fully qualified path.
protected  int verbosity
          Verbosity
 
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
Xml2bin()
           
 
Method Summary
 void addFileSet(org.apache.tools.ant.types.FileSet fileSet)
          Add file set
 void execute()
           
protected  void generateIni()
          Generates .ini file.
protected  String getMessage(Exception ex)
          Handle getMessage() for exceptions.
 void init()
           
 void setDestDir(File destDir)
          Set destination directory.
 void setEncoding(String encoding)
          Set the character encoding.
 void setExecutable(String executable)
          Set XPLATFORM xml2bin.exe.
 void setFailOnError(boolean failonerror)
          Set whether to fail when errors are encountered.
 void setIniFile(File iniFile)
          Set .ini file to generate.
 void setLogFile(String logFile)
          Set log file to generate.
 void setVerbose(boolean verbose)
          Set verbose mode.
protected  void validateAttributes()
          Ensure we have a consistent and legal set of attributes, and set any internal flags necessary based on different combinations of attributes.
protected  void validatePathLength(String path)
          Ensure source, target path length does not exceed MAX_PATH_LENGTH.
protected  void xml2bin()
          Compiles XPLATFORM files.
 
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, reconfigure, 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
 

Field Detail

iniFile

protected File iniFile
xml2bin .ini file.


logFile

protected String logFile
Log file fully qualified path.


destDir

protected File destDir
Destination directory


executable

protected String executable
xml2bin.exe executable file fully qualified path.


failonerror

protected boolean failonerror
Fail on error flag.


verbosity

protected int verbosity
Verbosity


exitValue

protected int exitValue
Exit value


encoding

protected String encoding
Charater encoding


fileSets

protected List<org.apache.tools.ant.types.FileSet> fileSets
File sets

Constructor Detail

Xml2bin

public Xml2bin()
Method Detail

init

public void init()
          throws org.apache.tools.ant.BuildException
Overrides:
init in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

generateIni

protected void generateIni()
Generates .ini file.


xml2bin

protected void xml2bin()
Compiles XPLATFORM files.


addFileSet

public void addFileSet(org.apache.tools.ant.types.FileSet fileSet)
Add file set

Parameters:
fileSet - file set for compile

validatePathLength

protected void validatePathLength(String path)
                           throws org.apache.tools.ant.BuildException
Ensure source, target path length does not exceed MAX_PATH_LENGTH.

Parameters:
path - The file path (drive character and file extension included).
Throws:
org.apache.tools.ant.BuildException - if path length exceeded.

validateAttributes

protected void validateAttributes()
                           throws org.apache.tools.ant.BuildException
Ensure we have a consistent and legal set of attributes, and set any internal flags necessary based on different combinations of attributes.

Throws:
org.apache.tools.ant.BuildException - if an error occurs.

getMessage

protected String getMessage(Exception ex)
Handle getMessage() for exceptions.

Parameters:
ex - the exception to handle
Returns:
ex.getMessage() if ex.getMessage() is not null otherwise return ex.toString()

setEncoding

public void setEncoding(String encoding)
Set the character encoding.

Parameters:
encoding - the character encoding.

setIniFile

public void setIniFile(File iniFile)
Set .ini file to generate.

Parameters:
iniFile - fully qualified path

setDestDir

public void setDestDir(File destDir)
Set destination directory.

Parameters:
destDir - destination directory.

setVerbose

public void setVerbose(boolean verbose)
Set verbose mode.

Parameters:
verbose - where to output log messages. Default is false.

setFailOnError

public void setFailOnError(boolean failonerror)
Set whether to fail when errors are encountered. If false, note errors to the output but keep going. Default is true.

Parameters:
failonerror - true or false.

setExecutable

public void setExecutable(String executable)
Set XPLATFORM xml2bin.exe.

Parameters:
executable - fully qualified path.

setLogFile

public void setLogFile(String logFile)
Set log file to generate.

Parameters:
logFile - fully qualified path.


Copyright © 2012 CODELABOR. All Rights Reserved.