com.threerings.cast.bundle.tools
Class MetadataBundlerTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.threerings.cast.bundle.tools.MetadataBundlerTask
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DirectoryMetadataBundlerTask

public class MetadataBundlerTask
extends Task

Ant task for creating metadata bundles, which contain action sequence and component class definition information. This task must be configured with a number of parameters:

 actiondef=[path to actions.xml]
 classdef=[path to classes.xml]
 file=[path to metadata bundle, which will be created]
 


Field Summary
protected  String _actionDef
           
protected  String _classDef
           
protected  File _target
           
 
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
MetadataBundlerTask()
           
 
Method Summary
protected static void addTileSetRuleSet(org.apache.commons.digester.Digester digester, TileSetRuleSet ruleSet)
          Configures ruleSet and hooks it into digester.
protected  OutputStream createOutputStream(File target)
          Creates the base output stream to which to write our bundle's files.
protected  void ensureSet(Object value, String errmsg)
           
 void execute()
          Performs the actual work of the task.
protected  OutputStream nextEntry(OutputStream lastEntry, String path)
          Advances to the next named entry in the bundle and returns the stream to which to write that entry.
protected  Tuple<Map<String,ActionSequence>,Map<String,TileSet>> parseActions()
           
protected  Map<String,ComponentClass> parseClasses()
           
protected  ArrayList<?> parseList(org.apache.commons.digester.Digester digester, String path)
           
 void setActiondef(String actiondef)
           
 void setClassdef(String classdef)
           
 void setTarget(File target)
           
 
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, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actionDef

protected String _actionDef

_classDef

protected String _classDef

_target

protected File _target
Constructor Detail

MetadataBundlerTask

public MetadataBundlerTask()
Method Detail

setActiondef

public void setActiondef(String actiondef)

setClassdef

public void setClassdef(String classdef)

setTarget

public void setTarget(File target)

execute

public void execute()
             throws BuildException
Performs the actual work of the task.

Overrides:
execute in class Task
Throws:
BuildException

createOutputStream

protected OutputStream createOutputStream(File target)
                                   throws IOException
Creates the base output stream to which to write our bundle's files.

Throws:
IOException

nextEntry

protected OutputStream nextEntry(OutputStream lastEntry,
                                 String path)
                          throws IOException
Advances to the next named entry in the bundle and returns the stream to which to write that entry.

Throws:
IOException

addTileSetRuleSet

protected static void addTileSetRuleSet(org.apache.commons.digester.Digester digester,
                                        TileSetRuleSet ruleSet)
Configures ruleSet and hooks it into digester.


parseActions

protected Tuple<Map<String,ActionSequence>,Map<String,TileSet>> parseActions()
                                                                      throws BuildException
Throws:
BuildException

parseClasses

protected Map<String,ComponentClass> parseClasses()
                                           throws BuildException
Throws:
BuildException

parseList

protected ArrayList<?> parseList(org.apache.commons.digester.Digester digester,
                                 String path)
                          throws BuildException
Throws:
BuildException

ensureSet

protected void ensureSet(Object value,
                         String errmsg)
                  throws BuildException
Throws:
BuildException