public class JavaConfigurationMetadataBuilder extends ConfigurationMetadataBuilder<javax.lang.model.element.TypeElement>
ConfigurationMetadataBuilder
for Java.ConfigurationMetadataBuilder
Constructor and Description |
---|
JavaConfigurationMetadataBuilder(javax.lang.model.util.Elements elements,
javax.lang.model.util.Types types,
AnnotationUtils annotationUtils) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
buildPropertyPath(javax.lang.model.element.TypeElement owningType,
javax.lang.model.element.TypeElement declaringType,
java.lang.String propertyName)
Build a property path for the given declaring type and property name.
|
protected java.lang.String |
buildTypePath(javax.lang.model.element.TypeElement owningType,
javax.lang.model.element.TypeElement declaringType)
Variation of
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String) for types. |
protected java.lang.String |
buildTypePath(javax.lang.model.element.TypeElement owningType,
javax.lang.model.element.TypeElement declaringType,
AnnotationMetadata annotationMetadata)
Variation of
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String) for types. |
protected AnnotationMetadata |
getAnnotationMetadata(javax.lang.model.element.TypeElement type) |
javax.lang.model.util.Elements |
getElements() |
protected java.lang.String |
getTypeString(javax.lang.model.element.TypeElement type)
Convert the given type to a string.
|
getConfigurations, getProperties, hasMetadata, visitProperties, visitProperties, visitProperty, visitProperty
public JavaConfigurationMetadataBuilder(javax.lang.model.util.Elements elements, javax.lang.model.util.Types types, AnnotationUtils annotationUtils)
elements
- The Elements
types
- The Types
annotationUtils
- The annotation utilspublic javax.lang.model.util.Elements getElements()
Elements
protected java.lang.String buildPropertyPath(javax.lang.model.element.TypeElement owningType, javax.lang.model.element.TypeElement declaringType, java.lang.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<javax.lang.model.element.TypeElement>
owningType
- The owning typedeclaringType
- The declaring typepropertyName
- The property nameprotected java.lang.String buildTypePath(javax.lang.model.element.TypeElement owningType, javax.lang.model.element.TypeElement declaringType, AnnotationMetadata annotationMetadata)
ConfigurationMetadataBuilder
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String)
for types.buildTypePath
in class ConfigurationMetadataBuilder<javax.lang.model.element.TypeElement>
owningType
- The owning typedeclaringType
- The typeannotationMetadata
- The annotation metadataprotected java.lang.String buildTypePath(javax.lang.model.element.TypeElement owningType, javax.lang.model.element.TypeElement declaringType)
ConfigurationMetadataBuilder
ConfigurationMetadataBuilder.buildPropertyPath(Object, Object, String)
for types.buildTypePath
in class ConfigurationMetadataBuilder<javax.lang.model.element.TypeElement>
owningType
- The owning typedeclaringType
- The typeprotected java.lang.String getTypeString(javax.lang.model.element.TypeElement type)
ConfigurationMetadataBuilder
getTypeString
in class ConfigurationMetadataBuilder<javax.lang.model.element.TypeElement>
type
- The typeprotected AnnotationMetadata getAnnotationMetadata(javax.lang.model.element.TypeElement type)
getAnnotationMetadata
in class ConfigurationMetadataBuilder<javax.lang.model.element.TypeElement>
type
- The type