public class GenUtility extends Object
| Modifier and Type | Field and Description |
|---|---|
static StringBuffer |
attributeInfo |
| Constructor and Description |
|---|
GenUtility() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addImport(TreeMap<String,String> map,
IntegerVar longest,
String i,
String c) |
static void |
appendAttributeInfo(BufferedWriter out,
AttributeDefinition ad) |
static void |
appendAttributeInfo(BufferedWriter out,
String n,
int ID,
String t,
ValueTypeEnum vte,
String opt) |
static void |
appendAttributeInfo(StringBuffer out,
String n,
int ID,
String t,
ValueTypeEnum vte,
String opt) |
static String |
dotNameToCamelCase(String in)
This method takes a dot name, for example app.event.explosion and turns it into a camel
case string like: AppEventExplosion
|
static void |
dumpComplexTypeDmcType(String header,
String basePackage,
String od,
String cn,
boolean containsRefs)
Dumps the DmcType required for a generated complex type.
|
static void |
dumpExtendedReferenceTypeDmcType(String header,
String basePackage,
String od,
String cn,
boolean containsRefs,
ExtendedReferenceTypeDefinition ertd)
Dumps the DmcType required for a generated complex type.
|
static void |
dumpIterable(String dmwdir,
String basePackage,
String typeImport,
String typeName,
String genericArgs,
String fileHeader,
PrintStream progress) |
static void |
dumpIterableREF(String dmwdir,
String basePackage,
String className,
boolean extended,
String extendedPackage,
String fileHeader,
PrintStream progress)
This method should only be called for named object types.
|
static void |
dumpMAPType(String dmotypedir,
String basePackage,
String baseTypeImport,
String typeName,
String primitiveImport,
String nameAttrImport,
String nameAttr,
String genericArgs,
String keyClass,
String keyImport,
String fileHeader,
PrintStream progress) |
static void |
dumpMVType(String dmotypedir,
String basePackage,
String baseTypeImport,
String typeName,
String dmcTypeImport,
String nameAttrImport,
String nameAttr,
String genericArgs,
boolean isRef,
String fileHeader,
PrintStream progress) |
static void |
dumpObjectIterable(String dmwdir,
String basePackage,
String typeImport,
String typeName,
String dmwImport,
String genericArgs,
String fileHeader,
PrintStream progress) |
static void |
dumpSETType(String dmotypedir,
String basePackage,
String baseTypeImport,
String typeName,
String dmcTypeImport,
String nameAttrImport,
String nameAttr,
String genericArgs,
boolean isRef,
String fileHeader,
PrintStream progress) |
static void |
dumpSTATICType(String dmotypedir,
String basePackage,
String baseTypeImport,
String typeName,
String dmcTypeImport,
String nameAttrImport,
String nameAttr,
String nameAttrID,
String genericArgs,
boolean isRef,
boolean isNameType,
boolean isFilterType,
String fileHeader,
PrintStream progress) |
static void |
dumpSVType(String dmotypedir,
String basePackage,
String baseTypeImport,
String typeName,
String dmcTypeImport,
String nameAttrImport,
String nameAttr,
String nameAttrID,
String genericArgs,
boolean isRef,
boolean isNameType,
boolean isFilterType,
String fileHeader,
PrintStream progress) |
static String |
formatImports(TreeMap<String,String> map,
int longest) |
static void |
formatMAPPED(AttributeDefinition ad,
StringBuffer sb) |
static void |
formatMV(AttributeDefinition ad,
StringBuffer sb) |
static void |
formatMVObjectAccess(AttributeDefinition ad,
StringBuffer sb)
This is a specialized function used to format ActionTriggerInfo derivatives.
|
static void |
formatSV(AttributeDefinition ad,
StringBuffer sb) |
static void |
formatSVObjectAccess(AttributeDefinition ad,
StringBuffer sb)
This is a specialized function used to format ActionTriggerInfo derivatives.
|
static String |
getClassFromImport(String value)
Returns the class or interface name after the last dot in an import statement.
|
static String |
getImports(ActionDefinition ad,
ArrayList<AttributeDefinition> allAttr,
BooleanVar anySVAttributes,
BooleanVar anyMVAttributes) |
static String |
getImports(ClassDefinition cd,
Iterator<AttributeDefinition> may,
Iterator<AttributeDefinition> must,
ArrayList<AttributeDefinition> allAttr,
BooleanVar anySVAttributes,
BooleanVar anyMVAttributes) |
public static StringBuffer attributeInfo
public static String getImports(ActionDefinition ad, ArrayList<AttributeDefinition> allAttr, BooleanVar anySVAttributes, BooleanVar anyMVAttributes) throws ResultException
ResultExceptionpublic static String getImports(ClassDefinition cd, Iterator<AttributeDefinition> may, Iterator<AttributeDefinition> must, ArrayList<AttributeDefinition> allAttr, BooleanVar anySVAttributes, BooleanVar anyMVAttributes) throws ResultException
ResultExceptionpublic static void addImport(TreeMap<String,String> map, IntegerVar longest, String i, String c)
public static String dotNameToCamelCase(String in)
public static void appendAttributeInfo(StringBuffer out, String n, int ID, String t, ValueTypeEnum vte, String opt)
public static void appendAttributeInfo(BufferedWriter out, String n, int ID, String t, ValueTypeEnum vte, String opt) throws IOException
IOExceptionpublic static void appendAttributeInfo(BufferedWriter out, AttributeDefinition ad) throws IOException
IOExceptionpublic static void formatSV(AttributeDefinition ad, StringBuffer sb)
public static void formatSVObjectAccess(AttributeDefinition ad, StringBuffer sb)
ad - the attribute we're accessingsb - the string buffer to which we write the functionpublic static void formatMVObjectAccess(AttributeDefinition ad, StringBuffer sb)
ad - the attribute we're accessingsb - the string buffer to which we write the functionpublic static void formatMV(AttributeDefinition ad, StringBuffer sb)
public static void formatMAPPED(AttributeDefinition ad, StringBuffer sb)
public static String getClassFromImport(String value)
value - the import statement e.g. org.dmd.dmc.DmcObjectpublic static void dumpIterable(String dmwdir, String basePackage, String typeImport, String typeName, String genericArgs, String fileHeader, PrintStream progress) throws IOException
IOExceptionpublic static void dumpObjectIterable(String dmwdir, String basePackage, String typeImport, String typeName, String dmwImport, String genericArgs, String fileHeader, PrintStream progress) throws IOException
IOExceptionpublic static void dumpIterableREF(String dmwdir, String basePackage, String className, boolean extended, String extendedPackage, String fileHeader, PrintStream progress) throws IOException
dmwdir - The output directory.basePackage - The base package for the generated code.className - the for which we're generating the iterator.extended - flag indicating if the calss is extended.extendedPackage - the package if the class is extended.fileHeader - the header to be dumped on the file.progress - the progress reporting stream.IOExceptionpublic static void dumpSVType(String dmotypedir, String basePackage, String baseTypeImport, String typeName, String dmcTypeImport, String nameAttrImport, String nameAttr, String nameAttrID, String genericArgs, boolean isRef, boolean isNameType, boolean isFilterType, String fileHeader, PrintStream progress) throws IOException
dmotypedir - basePackage - baseTypeImport - typeName - dmcTypeImport - nameAttrImport - nameAttr - nameAttrID - genericArgs - isRef - isNameType - isFilterType - if this is a filter type, we overload the nameAttrID to have the ID of the filterAttributeDef from the TypeDefinitionfileHeader - progress - IOExceptionpublic static void dumpSTATICType(String dmotypedir, String basePackage, String baseTypeImport, String typeName, String dmcTypeImport, String nameAttrImport, String nameAttr, String nameAttrID, String genericArgs, boolean isRef, boolean isNameType, boolean isFilterType, String fileHeader, PrintStream progress) throws IOException
dmotypedir - basePackage - baseTypeImport - typeName - dmcTypeImport - nameAttrImport - nameAttr - fileHeader - progress - IOExceptionpublic static void dumpMVType(String dmotypedir, String basePackage, String baseTypeImport, String typeName, String dmcTypeImport, String nameAttrImport, String nameAttr, String genericArgs, boolean isRef, String fileHeader, PrintStream progress) throws IOException
dmotypedir - basePackage - baseTypeImport - typeName - dmcTypeImport - nameAttrImport - nameAttr - fileHeader - progress - IOExceptionpublic static void dumpSETType(String dmotypedir, String basePackage, String baseTypeImport, String typeName, String dmcTypeImport, String nameAttrImport, String nameAttr, String genericArgs, boolean isRef, String fileHeader, PrintStream progress) throws IOException
dmotypedir - basePackage - baseTypeImport - typeName - dmcTypeImport - nameAttrImport - nameAttr - fileHeader - progress - IOExceptionpublic static void dumpMAPType(String dmotypedir, String basePackage, String baseTypeImport, String typeName, String primitiveImport, String nameAttrImport, String nameAttr, String genericArgs, String keyClass, String keyImport, String fileHeader, PrintStream progress) throws IOException
dmotypedir - basePackage - baseTypeImport - typeName - primitiveImport - nameAttrImport - nameAttr - fileHeader - progress - IOExceptionpublic static void dumpComplexTypeDmcType(String header, String basePackage, String od, String cn, boolean containsRefs) throws IOException
header - The file header or ""basePackage - The base package where this code will be generated - .generated.types will be appended to this package.od - The output directory.cn - The class name of the complex type.containsRefs - a flag to indicate if the complex type contains reference typesIOExceptionpublic static void dumpExtendedReferenceTypeDmcType(String header, String basePackage, String od, String cn, boolean containsRefs, ExtendedReferenceTypeDefinition ertd) throws IOException
header - The file header or ""basePackage - The base package where this code will be generated - .generated.types will be appended to this package.od - The output directory.cn - The class name of the complex type.containsRefs - a flag to indicate if the complex type contains reference typesIOExceptionCopyright © 2023. All rights reserved.