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) |
static Description |
buildDescription(java.lang.Object object,
DescriptionBuilder builder,
boolean includeAnnotatedFieldProperties) |
static java.util.List<Property> |
buildFieldProperties(java.lang.Class<?> aClass)
Return the list of properties by introspecting the annotated fields for
PluginProperty |
static void |
buildFieldProperties(java.lang.Class<?> aClass,
DescriptionBuilder builder)
Add properties based on introspection of a class
|
static java.util.List<Property> |
buildFieldProperties(java.lang.Object object)
Return the list of properties by introspecting the annotated fields for
PluginProperty |
static void |
buildFieldProperties(java.lang.Object object,
DescriptionBuilder builder)
Add properties based on introspection of the object
|
static boolean |
canBuildDescription(java.lang.Object object) |
static java.util.Map<java.lang.String,java.lang.Object> |
configureObjectFieldsWithProperties(java.lang.Object object,
java.util.List<Property> properties,
java.util.Map<java.lang.String,java.lang.Object> inputConfig)
Set field values on an object given a list of properties and input values for those properties
|
static java.util.Map<java.lang.String,java.lang.Object> |
configureObjectFieldsWithProperties(java.lang.Object object,
java.util.Map<java.lang.String,java.lang.Object> inputConfig)
Set field values on an object using introspection and input values for those properties
|
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
|
static java.util.Map<java.lang.String,java.lang.Object> |
mapProperties(PropertyResolver resolver,
java.util.List<Property> properties,
PropertyScope defaultPropertyScope)
Retrieve the Properties mapped to resolved values given the resolver, with a default property
scope
|
public static boolean canBuildDescription(java.lang.Object object)
object
- potential plugin object annotated with Plugin
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.List<Property> buildFieldProperties(java.lang.Object object)
PluginProperty
object
- objectpublic static java.util.List<Property> buildFieldProperties(java.lang.Class<?> aClass)
PluginProperty
aClass
- classpublic static void buildFieldProperties(java.lang.Object object, DescriptionBuilder builder)
object
- objectbuilder
- builderpublic static void buildFieldProperties(java.lang.Class<?> aClass, DescriptionBuilder builder)
aClass
- classbuilder
- builderpublic static java.util.Map<java.lang.String,java.lang.Object> configureProperties(PropertyResolver resolver, java.lang.Object object)
resolver
- property resolverobject
- plugin objectpublic 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> configureObjectFieldsWithProperties(java.lang.Object object, java.util.Map<java.lang.String,java.lang.Object> inputConfig)
object
- objectinputConfig
- inputpublic static java.util.Map<java.lang.String,java.lang.Object> configureObjectFieldsWithProperties(java.lang.Object object, java.util.List<Property> properties, java.util.Map<java.lang.String,java.lang.Object> inputConfig)
object
- objectproperties
- propertiesinputConfig
- inputpublic static java.util.Map<java.lang.String,java.lang.Object> mapDescribedProperties(PropertyResolver resolver, Description description)
resolver
- property resolverdescription
- plugin descriptionpublic static java.util.Map<java.lang.String,java.lang.Object> mapDescribedProperties(PropertyResolver resolver, Description description, PropertyScope defaultPropertyScope)
resolver
- property resolverdescription
- plugin descriptiondefaultPropertyScope
- default scope for unspecified property scopespublic static java.util.Map<java.lang.String,java.lang.Object> mapProperties(PropertyResolver resolver, java.util.List<Property> properties, PropertyScope defaultPropertyScope)
resolver
- property resolverproperties
- propertiesdefaultPropertyScope
- default scope for unspecified property scopes