java.lang.Object
io.helidon.codegen.CodegenUtil
Tools for generating code.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
capitalize
(String name) Capitalize the first letter of the provided string.static String
Provides copyright header to be added before package declaration.static Annotation
generatedAnnotation
(TypeName generator, TypeName trigger, TypeName generatedType, String versionId, String comments) Create a generated annotation.static String
toConstantName
(String elementName) Create a constant field for a name of an element.
-
Method Details
-
capitalize
Capitalize the first letter of the provided string.- Parameters:
name
- string to capitalize- Returns:
- name with the first character as capital letter
-
toConstantName
Create a constant field for a name of an element.For example for
maxInitialLineLength
we would getMAX_INITIAL_LINE_LENGTH
.- Parameters:
elementName
- name of the element- Returns:
- name of a constant
-
copyright
Provides copyright header to be added before package declaration.- Parameters:
generator
- type of the generator (annotation processor)trigger
- type of the class that caused this type to be generatedgeneratedType
- type that is going to be generated- Returns:
- copyright string (can be multiline)
-
generatedAnnotation
public static Annotation generatedAnnotation(TypeName generator, TypeName trigger, TypeName generatedType, String versionId, String comments) Create a generated annotation.- Parameters:
generator
- type of the generator (annotation processor)trigger
- type of the class that caused this type to be generatedgeneratedType
- type that is going to be generatedversionId
- version of the generatorcomments
- additional comments, never use null (use empty string so they do not appear in annotation)- Returns:
- a new annotation to add to the generated type
-