|
|||||||||
| 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
com.threerings.presents.tools.GenTask
com.threerings.presents.tools.InvocationTask
com.threerings.presents.tools.GenServiceTask
public class GenServiceTask
An Ant task for generating invocation service marshalling and unmarshalling classes. TODO: when generating the imports for exported action script files, there are just enough conversions of primitive types (e.g. float -> Number), array types (e.g. int[] -> TypedArray) and three rings utility types (e.g. float -> Float) to make the existing serivces work. It should be possible to create a complete list of these conversions so that future services can be generated without problems.
| Nested Class Summary | |
|---|---|
class |
GenServiceTask.Adapter
Used to track services for which we should create listener adapters in actionscript. |
class |
GenServiceTask.Providerless
Used to track services for which we should not generate a provider interface. |
protected class |
GenServiceTask.ServiceDescription
Rolls up everything needed for the generate* methods. |
class |
GenServiceTask.ServiceListener
Used to keep track of custom InvocationListener derivations. |
| Nested classes/interfaces inherited from class com.threerings.presents.tools.InvocationTask |
|---|
InvocationTask.ListenerArgument, InvocationTask.ServiceMethod |
| Field Summary | |
|---|---|
protected Set<String> |
_aslistenerAdapters
Services for which we should generate actionscript listener adapters. |
protected File |
_asroot
The path to our ActionScript source files. |
protected Set<String> |
_providerless
Services for which we should not generate provider interfaces. |
protected boolean |
_verbose
Show extra output if set. |
protected static String |
AS_LISTENER_ADAPTER_SERVICE_TMPL
Specifies the path to the ActionScript listener adapter service template. |
protected static String |
AS_LISTENER_MARSHALLER_TMPL
Specifies the path to the ActionScript listener marshaller template. |
protected static String |
AS_LISTENER_SERVICE_TMPL
Specifies the path to the ActionScript listener service template. |
protected static String |
AS_MARSHALLER_TMPL
Specifies the path to the ActionScript marshaller template. |
protected static String |
AS_SERVICE_TMPL
Specifies the path to the ActionScript service template. |
protected static String |
DISPATCHER_TMPL
Specifies the path to the dispatcher template. |
protected static String |
MARSHALLER_TMPL
Specifies the path to the marshaller template. |
protected static String |
PROVIDER_TMPL
Specifies the path to the provider template. |
| Fields inherited from class com.threerings.presents.tools.InvocationTask |
|---|
_iclient, _ilistener |
| Fields inherited from class com.threerings.presents.tools.GenTask |
|---|
_checking, _cloader, _filesets, _header, _modifiedPaths, EOL |
| 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 | |
|---|---|
GenServiceTask()
|
|
| Method Summary | |
|---|---|
GenServiceTask.Adapter |
createAdapter()
|
GenServiceTask.Providerless |
createProviderless()
|
protected void |
generateDispatcher(File source,
GenServiceTask.ServiceDescription sdesc)
|
protected void |
generateMarshaller(File source,
GenServiceTask.ServiceDescription sdesc)
|
protected void |
generateProvider(File source,
GenServiceTask.ServiceDescription sdesc)
|
protected String |
getGeneratedAnnotation(String name)
Helper to get the appropriate "@Generated" annotation for service classes. |
void |
processClass(File source,
Class<?> service)
Process a class found from the given source file that was on the filesets given to this task. |
void |
setAsroot(File asroot)
Configures the path to our ActionScript source files. |
void |
setVerbose(boolean verbose)
Configures to output extra information when generating code. |
| Methods inherited from class com.threerings.presents.tools.InvocationTask |
|---|
checkedAdd, createAndGatherImports, execute, replacePath |
| Methods inherited from class com.threerings.presents.tools.GenTask |
|---|
addFileset, convertEols, createMap, loadClass, loadClass, mergeTemplate, mergeTemplate, setChecking, setClasspathref, setHeader, wouldProduceSameFile, writeFile, writeTemplate, writeTemplate |
| 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 |
|---|
protected boolean _verbose
protected File _asroot
protected Set<String> _providerless
protected Set<String> _aslistenerAdapters
protected static final String MARSHALLER_TMPL
protected static final String DISPATCHER_TMPL
protected static final String PROVIDER_TMPL
protected static final String AS_SERVICE_TMPL
protected static final String AS_LISTENER_SERVICE_TMPL
protected static final String AS_LISTENER_ADAPTER_SERVICE_TMPL
protected static final String AS_MARSHALLER_TMPL
protected static final String AS_LISTENER_MARSHALLER_TMPL
| Constructor Detail |
|---|
public GenServiceTask()
| Method Detail |
|---|
public void setVerbose(boolean verbose)
public void setAsroot(File asroot)
public GenServiceTask.Providerless createProviderless()
public GenServiceTask.Adapter createAdapter()
public void processClass(File source,
Class<?> service)
throws Exception
GenTask
processClass in class GenTaskException
protected void generateMarshaller(File source,
GenServiceTask.ServiceDescription sdesc)
throws Exception
Exception
protected void generateDispatcher(File source,
GenServiceTask.ServiceDescription sdesc)
throws Exception
Exception
protected void generateProvider(File source,
GenServiceTask.ServiceDescription sdesc)
throws Exception
Exceptionprotected String getGeneratedAnnotation(String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||