Interface CodeFactory
public interface CodeFactory
This is a low-level factory for code objects. It is not designed for end-users of this API but rather for internal
and SPI usage.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateExpression(Object value, boolean primitive) createField(CodeFields parent, String name, Field reflectiveObject) createGetter(CodeType type, String propertyName, CodeGenericType propertyType, boolean implement, String... doc) createMethod(CodeMethods parent, String name, Method reflectiveObject) createSetter(CodeType type, String propertyName, CodeGenericType propertyType, boolean implement, String... doc)
-
Method Details
-
createExpression
- Parameters:
value- the Java value to wrap as constant/literalCodeExpression.primitive- -truefor a primitive type literal,falseotherwise.- Returns:
- the according
CodeExpression.
-
createField
- Parameters:
parent- theparent.name- thename. May benull.reflectiveObject- thereflective object. May benull.- Returns:
- a new
CodeField.
-
createMethod
- Parameters:
parent- theparent.name- thename. May benull.reflectiveObject- thereflective object. May benull.- Returns:
- the new
CodeMethod
-
createGetter
CodeMethod createGetter(CodeType type, String propertyName, CodeGenericType propertyType, boolean implement, String... doc) - Parameters:
type- theCodeTypein which the getter shall be created.propertyName- theproperty name.propertyType- theproperty type.implement- -trueto also add a method body with the implementation,falseotherwise (abstract method signature).doc- the optional documentation of the property.- Returns:
- the new getter
method.
-
createSetter
CodeMethod createSetter(CodeType type, String propertyName, CodeGenericType propertyType, boolean implement, String... doc) - Parameters:
type- theCodeTypein which the setter shall be created.propertyName- theproperty name.propertyType- theproperty type.implement- -trueto also add a method body with the implementation,falseotherwise (abstract method signature).doc- the optional documentation of the property.- Returns:
- the new setter
method.
-