|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.gen.ImportUtils
public class ImportUtils
Methods for mangling strings.
Field Summary | |
---|---|
static String[] |
importOrdering
|
protected Map<String,String> |
importTypesMap
|
protected String |
packageName
|
protected Map<String,String> |
reservedImportTypesMap
|
Constructor Summary | |
---|---|
ImportUtils()
|
Method Summary | |
---|---|
void |
addReservedType(String typeName)
Reserve a fully-qualified data type class name so it cannot be used by another class. |
void |
addType(String typeName)
Register a fully-qualified data type class name. |
protected boolean |
canRegisterType(String typeName)
|
String |
formatJavaType(String typeName)
Removes registered package and non-reserved registered type name prefixes from java types |
String |
formatJavaType(String typeName,
boolean usePrimitives)
Performs processing similar to formatJavaType(String) , with special
handling of primitive types and their Java class counterparts. |
String |
formatJavaTypeAsNonBooleanPrimitive(String type)
|
String |
generate()
Generate package and list of import statements based on the registered types. |
boolean |
isBoolean(String type)
|
boolean |
isNonBooleanPrimitive(String type)
|
void |
setPackage(String packageName)
Add the package name to use for this importUtil invocation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] importOrdering
protected Map<String,String> importTypesMap
protected Map<String,String> reservedImportTypesMap
protected String packageName
Constructor Detail |
---|
public ImportUtils()
Method Detail |
---|
protected boolean canRegisterType(String typeName)
public void addReservedType(String typeName)
typeName
- FQ data type class name.public void addType(String typeName)
typeName
- FQ data type class name.public void setPackage(String packageName)
packageName
- public String formatJavaType(String typeName, boolean usePrimitives)
formatJavaType(String)
, with special
handling of primitive types and their Java class counterparts. This method allows
users to make a decision whether to use primitives or not, regardless of how type
is mapped.
public String formatJavaType(String typeName)
public String formatJavaTypeAsNonBooleanPrimitive(String type)
public boolean isNonBooleanPrimitive(String type)
public boolean isBoolean(String type)
public String generate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |