Class ClassModel
java.lang.Object
io.helidon.codegen.classmodel.ClassBase
io.helidon.codegen.classmodel.ClassModel
Entry point to create class model.
This model contain all needed information for each generated type and handles resulting generation.
The following types are supported
(through ClassBase.Builder.classType(io.helidon.common.types.ElementKind)):
ElementKind.CLASS: classElementKind.INTERFACE: interface, all fields are constants, cannot have constructorElementKind.ENUM: enum, useClassBase.Builder.addEnumConstant(java.util.function.Consumer)to add enum constantsElementKind.RECORD: record, useClassBase.Builder.addField(Field)to add record components, as non-static fields are not supported in records
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault padding used in the generated type.static final StringPadding token used for identifying extra padding requirement for content formatting.static final StringType token is used to prepend and append to the fully qualified type names to support import handling.static final StringPattern in which are type names saved in the content templates. -
Method Summary
Modifier and TypeMethodDescriptionAccess modifier of this component.List of annotations on this component.static ClassModel.Builderbuilder()Create newClassModel.Builderinstance.Description (javadoc) of this component.name()Name of this component.toString()typeName()Type name of this class.voidWrite created type model.voidWrite created type model.Methods inherited from class ClassBase
constructors, fields, genericArguments, innerClasses, interfaceTypeNames, isAbstract, isFinal, isStatic, kind, methods, permittedSubclassTypeNames, sealed, superTypeNameModifier and TypeMethodDescriptionAll declared constructors.fields()All declared fields.Generic type parameters declared by this type, including their bounds.All declared inner classes.Implemented interfaces.booleanIs this an abstract class.booleanisFinal()Is this a final class.booleanisStatic()Is this a static class.kind()Kind of this type.methods()All declared methods.Permitted direct subclasses of this sealed class or interface.booleansealed()Is this a sealed class or interface.Type name of the super class (if this is a class and it extends another class).
-
Field Details
-
PADDING_TOKEN
Padding token used for identifying extra padding requirement for content formatting.- See Also:
-
TYPE_TOKEN
Type token is used to prepend and append to the fully qualified type names to support import handling.- See Also:
-
TYPE_TOKEN_PATTERN
Pattern in which are type names saved in the content templates.- See Also:
-
DEFAULT_PADDING
-
-
Method Details
-
builder
Create newClassModel.Builderinstance.- Returns:
- new builder instance
-
write
Write created type model. Default paddingDEFAULT_PADDINGis used.- Parameters:
writer- writer to be used- Throws:
IOException- write operation failure
-
write
Write created type model.- Parameters:
writer- writer to be usedpadding- padding to be used- Throws:
IOException- write operation failure
-
typeName
-
toString
-
annotations
-
name
-
accessModifier
-
description
-