com.sonyericsson.hudson.plugins.metadata.model.values
Class AbstractMetadataValue.AbstractMetaDataValueDescriptor

java.lang.Object
  extended by hudson.model.Descriptor<AbstractMetadataValue>
      extended by com.sonyericsson.hudson.plugins.metadata.model.values.AbstractMetadataValue.AbstractMetaDataValueDescriptor
All Implemented Interfaces:
hudson.model.Saveable
Direct Known Subclasses:
DateMetadataValue.DateMetaDataValueDescriptor, NumberMetadataValue.NumberMetaDataValueDescriptor, StringMetadataValue.StringMetaDataValueDescriptor, TreeNodeMetadataValue.TreeNodeMetaDataValueDescriptor
Enclosing class:
AbstractMetadataValue

public abstract static class AbstractMetadataValue.AbstractMetaDataValueDescriptor
extends hudson.model.Descriptor<AbstractMetadataValue>

The descriptor for the AbstractMetadataValue.


Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType, hudson.model.Descriptor.Self
 
Field Summary
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
AbstractMetadataValue.AbstractMetaDataValueDescriptor()
           
 
Method Summary
 boolean appliesTo(hudson.model.Descriptor containerDescriptor)
          Tells if values of this descriptor can be added to the specified container type or not.
static AbstractMetadataValue.AbstractMetaDataValueDescriptor findForJsonType(String type)
          Finds the descriptor for the given metadata-type.
abstract  MetadataValue fromJson(net.sf.json.JSONObject json, MetadataContainer<MetadataValue> container)
          Converts a JSON object into a MetadataValue of this descriptors describable.
abstract  String getJsonType()
          Gives the type to put into the JSON conversations.
 
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMetadataValue.AbstractMetaDataValueDescriptor

public AbstractMetadataValue.AbstractMetaDataValueDescriptor()
Method Detail

appliesTo

public boolean appliesTo(hudson.model.Descriptor containerDescriptor)
Tells if values of this descriptor can be added to the specified container type or not. Some value types might not apply to be added to a node and vice versa. The default implementation always returns true.

Parameters:
containerDescriptor - the descriptor for the container that the values of this type can be added to. Can be null.
Returns:
true if it applies.

findForJsonType

public static AbstractMetadataValue.AbstractMetaDataValueDescriptor findForJsonType(String type)
Finds the descriptor for the given metadata-type.

Parameters:
type - the type to find.
Returns:
the Descriptor or null if non is found.

getJsonType

public abstract String getJsonType()
Gives the type to put into the JSON conversations.

Returns:
the JSON type field.

fromJson

public abstract MetadataValue fromJson(net.sf.json.JSONObject json,
                                       MetadataContainer<MetadataValue> container)
                                throws JsonUtils.ParseException
Converts a JSON object into a MetadataValue of this descriptors describable.

Parameters:
json - the json data to use.
container - The container that the created object is intended to go into. Can be used to check for validity of attributes.
Returns:
the converted value.
Throws:
JsonUtils.ParseException - if something is for example missing.


Copyright © 2004-2013. All Rights Reserved.