Package com.sforce.ws.codegen
Class Generator
- java.lang.Object
-
- com.sforce.ws.codegen.Generator
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGGREGATE_RESULTTemplate namesstatic StringEXTENDED_ERROR_DETAILSprotected booleangenerateInterfacesstatic StringIEXTENDED_ERROR_DETAILSstatic StringISOBJECTprotected ArrayList<File>javaFilesprotected StringpackagePrefixstatic StringSIMPLE_TYPEstatic StringSOBJECTprotected org.stringtemplate.v4.STGroupDirtemplatesstatic StringTYPEstatic StringTYPE_INTERFACEprotected TypeMappertypeMapper
-
Constructor Summary
Constructors Constructor Description Generator(String packagePrefix, org.stringtemplate.v4.STGroupDir templates, String interfacePackagePrefix)Generator(String packagePrefix, org.stringtemplate.v4.STGroupDir templates, String interfacePackagePrefix, boolean javaTime)Generator(String packagePrefix, org.stringtemplate.v4.STGroupDir templates, String interfacePackagePrefix, char startDelim, char endDelim)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFileToJar(String className, String classFile, JarOutputStream jar)protected voidaddRuntimeClasses(JarOutputStream jar)protected voidcompileTypes()protected voidgenerate(Definitions definitions, SfdcApiType sfdcApiType, Types types, File dir)protected Filegenerate(String packageName, String fileName, Object gen, org.stringtemplate.v4.ST template, File dir)voidgenerate(URL wsdl, File dest)protected voidgenerateAggregateResultClasses(Definitions definitions, File dir)protected voidgenerateAggregateResultClasses(String packageName, File dir)protected voidgenerateClassFromComplexType(Types types, Schema schema, ComplexType complexType, File dir)protected voidgenerateClassFromSimpleType(Schema schema, SimpleType simpleType, File dir)protected voidgenerateComplexTypeClass(Types types, Schema schema, File dir)protected voidgenerateExtendedErrorDetailsClasses(Definitions definitions, File dir)protected voidgenerateJarFile(File jarFile, boolean standAlone, File dir)protected voidgenerateSimpleTypeClass(Schema schema, File dir)protected voidgenerateSObjectClass(Definitions definitions, File dir)protected voidgenerateSObjectInterface(Definitions definitions, File dir)protected voidgenerateTypeClass(Types types, Schema schema, File dir)protected voidgenerateTypeClasses(Types types, File dir)protected StringgetInterfacePackageName(String packageName)protected InputStreamgetManifest()protected StringgetPackageName(Definitions definitions)protected ArrayList<String>getRuntimeClasses(ClassLoader cl)protected WriternewSourceWriter(File source)Extension point for embedding applications, like Maven plugins, to provide custom I/O primitives.protected TypeMetadataConstructornewTypeMetadataConstructor(Types types, Schema schema, ComplexType complexType, File dir)Extension point for embedding applications, like Maven plugins, to customize TypeMetadataConstructor without changing system properties.protected booleanrequiresAggregateResultClass(Definitions definitions)protected booleanrequiresSObjectClass(Definitions definitions)protected booleanrequiresSObjectInterface(Definitions definitions)
-
-
-
Field Detail
-
AGGREGATE_RESULT
public static final String AGGREGATE_RESULT
Template names- See Also:
- Constant Field Values
-
SIMPLE_TYPE
public static final String SIMPLE_TYPE
- See Also:
- Constant Field Values
-
SOBJECT
public static final String SOBJECT
- See Also:
- Constant Field Values
-
ISOBJECT
public static final String ISOBJECT
- See Also:
- Constant Field Values
-
EXTENDED_ERROR_DETAILS
public static final String EXTENDED_ERROR_DETAILS
- See Also:
- Constant Field Values
-
IEXTENDED_ERROR_DETAILS
public static final String IEXTENDED_ERROR_DETAILS
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
TYPE_INTERFACE
public static final String TYPE_INTERFACE
- See Also:
- Constant Field Values
-
typeMapper
protected final TypeMapper typeMapper
-
packagePrefix
protected final String packagePrefix
-
templates
protected final org.stringtemplate.v4.STGroupDir templates
-
generateInterfaces
protected boolean generateInterfaces
-
-
Constructor Detail
-
Generator
public Generator(String packagePrefix, org.stringtemplate.v4.STGroupDir templates, String interfacePackagePrefix, char startDelim, char endDelim)
-
Generator
public Generator(String packagePrefix, org.stringtemplate.v4.STGroupDir templates, String interfacePackagePrefix)
-
-
Method Detail
-
generate
public void generate(URL wsdl, File dest) throws WsdlParseException, IOException
- Throws:
WsdlParseExceptionIOException
-
addFileToJar
protected void addFileToJar(String className, String classFile, JarOutputStream jar) throws IOException
- Throws:
IOException
-
addRuntimeClasses
protected void addRuntimeClasses(JarOutputStream jar) throws IOException
- Throws:
IOException
-
compileTypes
protected void compileTypes() throws ToolsException- Throws:
ToolsException
-
generate
protected void generate(Definitions definitions, SfdcApiType sfdcApiType, Types types, File dir) throws IOException
- Throws:
IOException
-
generate
protected File generate(String packageName, String fileName, Object gen, org.stringtemplate.v4.ST template, File dir) throws IOException
- Throws:
IOException
-
newSourceWriter
protected Writer newSourceWriter(File source) throws IOException
Extension point for embedding applications, like Maven plugins, to provide custom I/O primitives.- Throws:
IOException
-
generateAggregateResultClasses
protected void generateAggregateResultClasses(Definitions definitions, File dir) throws IOException
- Throws:
IOException
-
generateAggregateResultClasses
protected void generateAggregateResultClasses(String packageName, File dir) throws IOException
- Throws:
IOException
-
generateExtendedErrorDetailsClasses
protected void generateExtendedErrorDetailsClasses(Definitions definitions, File dir) throws IOException
- Throws:
IOException
-
generateClassFromComplexType
protected void generateClassFromComplexType(Types types, Schema schema, ComplexType complexType, File dir) throws IOException
- Throws:
IOException
-
newTypeMetadataConstructor
protected TypeMetadataConstructor newTypeMetadataConstructor(Types types, Schema schema, ComplexType complexType, File dir)
Extension point for embedding applications, like Maven plugins, to customize TypeMetadataConstructor without changing system properties.
-
generateClassFromSimpleType
protected void generateClassFromSimpleType(Schema schema, SimpleType simpleType, File dir) throws IOException
- Throws:
IOException
-
generateComplexTypeClass
protected void generateComplexTypeClass(Types types, Schema schema, File dir) throws IOException
- Throws:
IOException
-
generateJarFile
protected void generateJarFile(File jarFile, boolean standAlone, File dir) throws IOException
- Throws:
IOException
-
generateSimpleTypeClass
protected void generateSimpleTypeClass(Schema schema, File dir) throws IOException
- Throws:
IOException
-
generateSObjectClass
protected void generateSObjectClass(Definitions definitions, File dir) throws IOException
- Throws:
IOException
-
generateSObjectInterface
protected void generateSObjectInterface(Definitions definitions, File dir) throws IOException
- Throws:
IOException
-
generateTypeClass
protected void generateTypeClass(Types types, Schema schema, File dir) throws IOException
- Throws:
IOException
-
generateTypeClasses
protected void generateTypeClasses(Types types, File dir) throws IOException
- Throws:
IOException
-
getManifest
protected InputStream getManifest()
-
getPackageName
protected String getPackageName(Definitions definitions)
-
getRuntimeClasses
protected ArrayList<String> getRuntimeClasses(ClassLoader cl) throws IOException
- Throws:
IOException
-
requiresAggregateResultClass
protected boolean requiresAggregateResultClass(Definitions definitions)
-
requiresSObjectClass
protected boolean requiresSObjectClass(Definitions definitions)
-
requiresSObjectInterface
protected boolean requiresSObjectInterface(Definitions definitions)
-
-