public class JavaConfigurationMetadataBuilder extends ConfigurationMetadataBuilder<TypeElement>
ConfigurationMetadataBuilder
for Java.ConfigurationMetadataBuilder
Constructor and Description |
---|
JavaConfigurationMetadataBuilder(Elements elements,
Types types,
AnnotationUtils annotationUtils) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildPropertyPath(TypeElement owningType,
TypeElement declaringType,
String propertyName)
Build a property path for the given declaring type and property name.
|
protected String |
buildTypePath(TypeElement owningType,
TypeElement declaringType)
Variation of
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String) for types. |
protected String |
buildTypePath(TypeElement owningType,
TypeElement declaringType,
AnnotationMetadata annotationMetadata)
Variation of
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String) for types. |
protected AnnotationMetadata |
getAnnotationMetadata(TypeElement type) |
Elements |
getElements() |
Element[] |
getOriginatingElements() |
protected String |
getTypeString(TypeElement type)
Convert the given type to a string.
|
getConfigurationMetadataBuilder, getConfigurations, getProperties, hasMetadata, setConfigurationMetadataBuilder, visitProperties, visitProperties, visitProperty, visitProperty
public JavaConfigurationMetadataBuilder(Elements elements, Types types, AnnotationUtils annotationUtils)
@NonNull public Element[] getOriginatingElements()
getOriginatingElements
in class ConfigurationMetadataBuilder<TypeElement>
protected String buildPropertyPath(TypeElement owningType, TypeElement declaringType, String propertyName)
ConfigurationMetadataBuilder
Build a property path for the given declaring type and property name.
For ConfigurationProperties
that path is a property is
established by looking at the value of the ConfigurationProperties
and
then calculating the path based on the inheritance tree.
For example consider the following classes:
@ConfigurationProperties("parent")
public class ParentProperties {
String foo;
}
@ConfigurationProperties("child")
public class ChildProperties extends ParentProperties {
String bar;
}
The path of the property foo
will be "parent.foo" whilst the path of the property bar
will
be "parent.child.bar" factoring in the class hierarchy
Inner classes hierarchies are also taken into account
buildPropertyPath
in class ConfigurationMetadataBuilder<TypeElement>
owningType
- The owning typedeclaringType
- The declaring typepropertyName
- The property nameprotected String buildTypePath(TypeElement owningType, TypeElement declaringType, AnnotationMetadata annotationMetadata)
ConfigurationMetadataBuilder
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String)
for types.buildTypePath
in class ConfigurationMetadataBuilder<TypeElement>
owningType
- The owning typedeclaringType
- The typeannotationMetadata
- The annotation metadataprotected String buildTypePath(TypeElement owningType, TypeElement declaringType)
ConfigurationMetadataBuilder
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String)
for types.buildTypePath
in class ConfigurationMetadataBuilder<TypeElement>
owningType
- The owning typedeclaringType
- The typeprotected String getTypeString(TypeElement type)
ConfigurationMetadataBuilder
getTypeString
in class ConfigurationMetadataBuilder<TypeElement>
type
- The typeprotected AnnotationMetadata getAnnotationMetadata(TypeElement type)
getAnnotationMetadata
in class ConfigurationMetadataBuilder<TypeElement>
type
- The type