public class PluginAdapterUtility
extends java.lang.Object
Description
s from Plugin class annotations and setting property values for annotated
property fields.Constructor and Description |
---|
PluginAdapterUtility() |
Modifier and Type | Method and Description |
---|---|
static Description |
buildDescription(java.lang.Object object,
DescriptionBuilder builder)
Create a Description using a builder by analyzing the annotations on a plugin object, and including
annotations on fields as DescriptionProperties.
|
static Description |
buildDescription(java.lang.Object object,
DescriptionBuilder builder,
boolean includeAnnotatedFieldProperties)
Create a Description using a builder by analyzing the annotations on a plugin object.
|
static boolean |
canBuildDescription(java.lang.Object object)
Return true if the object has a valid Plugin annotation
|
static java.util.Map<java.lang.String,java.lang.Object> |
configureProperties(PropertyResolver resolver,
Description description,
java.lang.Object object,
PropertyScope defaultScope)
Set field values on a plugin object by using a Description, and setting field values to resolved property values.
|
static java.util.Map<java.lang.String,java.lang.Object> |
configureProperties(PropertyResolver resolver,
java.lang.Object object)
Set field values on a plugin object by using annotated field values to create a Description, and setting field
values to resolved property values.
|
static java.util.Map<java.lang.String,java.lang.Object> |
mapDescribedProperties(PropertyResolver resolver,
Description description)
Retrieve the Description's Properties mapped to resolved values given the resolver, using InsanceOnly default scope.
|
static java.util.Map<java.lang.String,java.lang.Object> |
mapDescribedProperties(PropertyResolver resolver,
Description description,
PropertyScope defaultPropertyScope)
Retrieve the Description's Properties mapped to resolved values given the resolver, with a default property
scope
|
public static boolean canBuildDescription(java.lang.Object object)
public static Description buildDescription(java.lang.Object object, DescriptionBuilder builder)
object
- the objectbuilder
- builderpublic static Description buildDescription(java.lang.Object object, DescriptionBuilder builder, boolean includeAnnotatedFieldProperties)
object
- the objectbuilder
- builderincludeAnnotatedFieldProperties
- if true, add DescriptionProperties to the Description based on annotations of fields in the class of the instancepublic static java.util.Map<java.lang.String,java.lang.Object> configureProperties(PropertyResolver resolver, java.lang.Object object)
public static java.util.Map<java.lang.String,java.lang.Object> configureProperties(PropertyResolver resolver, Description description, java.lang.Object object, PropertyScope defaultScope)
resolver
- the property resolverdescription
- the property descriptionsobject
- the target object, which can implement Configurable
, otherwise introspection will be useddefaultScope
- a default property scope to assume for unspecified propertiespublic static java.util.Map<java.lang.String,java.lang.Object> mapDescribedProperties(PropertyResolver resolver, Description description)
public static java.util.Map<java.lang.String,java.lang.Object> mapDescribedProperties(PropertyResolver resolver, Description description, PropertyScope defaultPropertyScope)