public class ProxyGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ProxyGenerator.AcceptAll
Accepts all classes.
|
static class |
ProxyGenerator.AccessibilityType
Indicates the member accessibility that proxies should expose.
|
static class |
ProxyGenerator.Builder
Builds a ProxyGenerator.
|
static class |
ProxyGenerator.FilteringCollection
Accepts a collection of classes.
|
static class |
ProxyGenerator.InvokeStyle
Type of method invocation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginNamespace(Writer output)
Generates the opening of a namespace.
|
void |
generateFieldDeclarations(Writer output,
boolean forPeer)
Generates the field declarations.
|
void |
generateFieldDefinitions(Writer output)
Same as generateFieldDefinitions(output, false).
|
void |
generateFieldDefinitions(Writer output,
boolean forPeer)
Generate the field definitions.
|
void |
generateHeader(Writer output)
Generates the proxy header.
|
void |
generateJaceDefinitions(Writer output)
Same as generateJaceDefinitions(output, false).
|
void |
generateJaceDefinitions(Writer output,
boolean forPeer)
Generate the jace-specific methods.
|
void |
generateMethodDeclaration(Writer output,
MetaClass metaClass,
ClassMethod method,
ProxyGenerator.InvokeStyle invokeStyle)
Generates the method declaration.
|
void |
generateMethodDefinitions(Writer output,
boolean forPeer)
Generate the method definitions.
|
void |
generateSource(Writer output)
Generates the proxy source code.
|
Set<MetaClass> |
getDependentClasses(boolean fullyDependent)
Returns the classes which the class we are generating is dependent upon.
|
String |
getInitializerValue()
Same as getInitializerValue(false).
|
String |
getInitializerValue(boolean forPeer)
Returns the initializer list for the current class.
|
void |
includeDependentHeaders(Writer output)
Includes the headers for the super-class and all implemented interfaces.
|
void |
includeStandardHeaders(Writer output,
boolean forPeer)
Generate includes for the Jace library headers, which should always be included.
|
void |
includeStandardSourceHeaders(Writer output)
Generates the source-code includes.
|
static void |
main(String[] args)
Generates a C++ proxy for a java class.
|
void |
makeForwardDeclarations(Writer output)
Make forward declarations for all of the types
for which the class is dependent.
|
void |
writeProxy(File outputHeaders,
File outputSources)
Generates the C++ proxy (header and source) for the specified class.
|
public void generateHeader(Writer output) throws IOException
output - the output writerIOException - if an I/O exception occurs while writing the header filepublic void generateSource(Writer output) throws IOException
output - the output writerIOException - if an I/O exception occurs while writing the source filepublic void includeStandardSourceHeaders(Writer output) throws IOException
output - the output writerIOException - if an I/O exception occurs while writingpublic void generateMethodDefinitions(Writer output, boolean forPeer) throws IOException
output - the output writerforPeer - true if the methods are being generated for a peer, false for a proxyIOException - if an error occurs while writingpublic void generateFieldDefinitions(Writer output) throws IOException
output - the output writerIOException - if an error occurs while writinggenerateFieldDefinitions(Writer, boolean)public void generateFieldDefinitions(Writer output, boolean forPeer) throws IOException
output - the output writerforPeer - true if the fields are being generated for a peer, false for a proxyIOException - if an error occurs while writingpublic void generateJaceDefinitions(Writer output) throws IOException
output - the output writerIOException - if an error occurs while writinggenerateJaceDefinitions(Writer, boolean).public void generateJaceDefinitions(Writer output, boolean forPeer) throws IOException
output - the output writerforPeer - true if the fields are being generated for a peer, false for a proxyIOException - if an error occurs while writingpublic String getInitializerValue()
defineInitializerValue(boolean)public String getInitializerValue(boolean forPeer)
forPeer - true if the methods are being generated for a peer, false for a proxypublic void generateMethodDeclaration(Writer output, MetaClass metaClass, ClassMethod method, ProxyGenerator.InvokeStyle invokeStyle) throws IOException
output - the output writermetaClass - the MetaClass describing the classmethod - the methodinvokeStyle - the method invocation styleIOException - if an error occurs while writingpublic void generateFieldDeclarations(Writer output, boolean forPeer) throws IOException
output - the output writerforPeer - true if the fields are being generated for a peer, false for a proxyIOException - if an error occurs while writingpublic void beginNamespace(Writer output) throws IOException
output - the output writerIOException - if an error occurs while writingpublic void includeStandardHeaders(Writer output, boolean forPeer) throws IOException
output - the output writerforPeer - true if the methods are being generated for a peer, false for a proxyIOException - if an error occurs while writingpublic void includeDependentHeaders(Writer output) throws IOException
output - the output writerIOException - if an error occurs while writingpublic void makeForwardDeclarations(Writer output) throws IOException
output - the output writerIOException - if an error occurs while writingpublic Set<MetaClass> getDependentClasses(boolean fullyDependent)
fullyDependent - true if the method is to return classes which need to
be fully defined before reference (such as fields).
Otherwise, false if the method is to return classes which may be forward
declared (array elements, exceptions and all other parameter types).public void writeProxy(File outputHeaders, File outputSources) throws IOException
outputHeaders - the directory to write the header file tooutputSources - the directory to write the source file toIOException - if an error occurs while writing the proxy filespublic static void main(String[] args)
args - the command-line argumentCopyright © 2011. All Rights Reserved.