public final class ProcessorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ExecutableElement |
getNoArgsConstructor(TypeElement type)
Returns the no-args constructor for
type , or null if no such constructor exists. |
static PackageElement |
getPackage(Element type)
Gets package form element.
|
static String |
resolveColumnName(VariableElement element,
Property column)
Resolve column name.
|
static String |
resolveIndexName(Index index,
String... columns)
Revolve index constraint name.
|
static String |
resolveTableName(TypeElement element,
Model model)
Revolve table name.
|
static String |
resolveUniqueName(Unique index,
String... columns)
Revolve unique constraint name.
|
static String |
typeToString(TypeMirror type)
Returns a string for
type . |
static void |
typeToString(TypeMirror typeMirror,
StringBuilder result,
char innerClassSeparator)
Appends a string for
type to result . |
public static String resolveTableName(TypeElement element, Model model)
element
- type.model
- entity.public static String resolveColumnName(VariableElement element, Property column)
element
- field.column
- column.public static String resolveUniqueName(Unique index, String... columns)
index
- annotation.columns
- columns.public static String resolveIndexName(Index index, String... columns)
index
- annotation.columns
- columns.public static PackageElement getPackage(Element type)
type
- elementpublic static String typeToString(TypeMirror type)
type
. Primitive types are always boxed.public static void typeToString(TypeMirror typeMirror, StringBuilder result, char innerClassSeparator)
type
to result
. Primitive types are always boxed.innerClassSeparator
- either '.' or '$', which will appear in a class name like
"java.lang.Map.Entry" or "java.lang.Map$Entry". Use '.' for
references to existing types in code. Use '$' to define new class
names and for strings that will be used by runtime reflection.public static ExecutableElement getNoArgsConstructor(TypeElement type)
type
, or null if no such constructor exists.Copyright © 2015. All Rights Reserved.