public interface IClassWriter extends IAnnotationWriter
| Modifier and Type | Method and Description |
|---|---|
IClassWriter |
asAbstract()
Define your generated entity to be an Abstract Class.
|
IClassWriter |
asAnnotation()
Define your generated entity to be an Annotation.
|
IClassWriter |
asClass()
Define your generated entity to be a Concrete Class (default).
|
IClassWriter |
asEnum()
Define your generated entity to be an Enum.
|
IClassWriter |
asInterface()
Define your generated entity to be an Interface.
|
Class<?> |
build()
Build your entity.
|
IClassWriter |
clone(String name)
Define a clone of all defined for your entity,
but with a new name because the old one is already in use.
|
IFieldWriter |
field(String name,
Class<?> type)
Add a field to your entity.
|
IFieldWriter |
fieldByParse(String fieldSignature)
Define a way to parse a field with all properties and annotations from a String.
|
IClassWriter |
interfaces(Class<?>... classes)
Define the interfaces that your generated entity will implements.
|
IMethodWriter |
method(IMethodReader method)
Add a method to your entity.
|
IMethodWriter |
method(String name)
Add a method to your entity.
|
IMethodWriter |
methodByParse(String methodSignature)
Define a way to parse a method with all properties and annotations from a String.
|
IClassWriter |
modifiers(ModifierEnum... modifiers)
Define the modifiers that you want in your entity.
|
IClassWriter |
name(String name)
Define the name of your entity, you can also inform the package as a prefix.
|
ISuperClassWriter |
superclass(Class<?> superclass)
Define a super class that your generated entity will extends.
|
IClassWriter |
version(JavaEnum javaEnum)
Define the version of JRE that your entity will be compiled.
|
IClassWriter |
visibility(VisibilityEnum visibility)
Define the visibility of your entity.
|
annotation, annotation, annotationIClassWriter asClass()
IClassWriter asInterface()
IClassWriter asAbstract()
IClassWriter asEnum()
IClassWriter asAnnotation()
IClassWriter version(JavaEnum javaEnum)
javaEnum - the version of java entityIClassWriter name(String name)
Ex: my.fake.package.MyGenericDynClass
name - of the entityIClassWriter visibility(VisibilityEnum visibility)
Ex: PUBLIC, PRIVATE or PROTECTED
visibility - of the entityIClassWriter modifiers(ModifierEnum... modifiers)
Ex: FINAL, ABSTRACT...
modifiers - of the entityISuperClassWriter superclass(Class<?> superclass)
superclass - to be extendedIClassWriter interfaces(Class<?>... classes)
classes - of interfacesIFieldWriter field(String name, Class<?> type)
name - of the fieldtype - class type of the fieldIFieldWriter fieldByParse(String fieldSignature)
- Semicolon is Optional
- Is better specify all class type with their respective packages, if you don't it will try to find your class type for you. So, it is possible to load a class type with the same name but in a different package.
Ex:
java.lang.String myField; // the default visibility is private
Ex:
final static String myField; // with modifiers (static and final)
Ex:
public String myField; // with visibility (public)
Ex:
private static final String myField; // with visibility and modifiers
Ex:
@Id // with annotation
@Column(name = \"MY_COLUMN_NAME\", nullable = false) // annotation and properties
private static final String myField; // with visibility and modifiers
fieldSignature - the signature of your field to parse.IMethodWriter method(String name)
name - of the method to be addedIMethodWriter method(IMethodReader method)
method - to be addedIMethodWriter methodByParse(String methodSignature)
- parentheses and braces are Optional
- Is better specify all class type with their respective packages, if you don't it will try to find your class type for you. So, it is possible to load a class type with the same name but in a different package.
Ex:
java.lang.String getMyMethod(){}; // the default visibility is public
Ex:
final static String getMyMethod; // with modifiers (static and final)
Ex:
public String getMyMethod; // with visibility (public)
Ex:
private static final String getMyMethod; // with visibility and modifiers
Ex:
@Id // with annotation
@Column(name = \"MY_COLUMN_NAME\", nullable = false) // annotation
private static final String getMyMethod; // with visibility and modifiers
Ex:
public String findById(@NotNull String code) throws NullPointerException; // with parameter and exception
methodSignature - the signature of your method to parse.Class<?> build()
IClassWriter clone(String name)
name - of your new entityCopyright © 2018 Esfinge Framework. All rights reserved.