com.dtolabs.rundeck.core.plugins.configuration
Class PluginAdapterUtility

java.lang.Object
  extended by com.dtolabs.rundeck.core.plugins.configuration.PluginAdapterUtility

public class PluginAdapterUtility
extends java.lang.Object

Utility for creating Descriptions from Plugin class annotations and setting property values for annotated property fields.


Constructor Summary
PluginAdapterUtility()
           
 
Method Summary
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginAdapterUtility

public PluginAdapterUtility()
Method Detail

canBuildDescription

public static boolean canBuildDescription(java.lang.Object object)
Return true if the object has a valid Plugin annotation


buildDescription

public 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.

Parameters:
object - the object
builder - builder

buildDescription

public 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.

Parameters:
object - the object
builder - builder
includeAnnotatedFieldProperties - if true, add DescriptionProperties to the Description based on annotations of fields in the class of the instance

configureProperties

public 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. Any resolved properties that are not mapped to a field will be included in the return result.

Returns:
Map of resolved properties that were not configured in the object's fields

configureProperties

public 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. Any resolved properties that are not mapped to a field will be included in the return result.

Parameters:
resolver - the property resolver
description - the property descriptions
object - the target object, which can implement Configurable, otherwise introspection will be used
defaultScope - a default property scope to assume for unspecified properties
Returns:
Map of resolved properties that were not configured in the object's fields

mapDescribedProperties

public 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.

Returns:
All mapped properties by name and value.

mapDescribedProperties

public 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

Returns:
All mapped properties by name and value.