com.sonyericsson.hudson.plugins.metadata.model.definitions
Class AbstractMetadataDefinition

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.metadata.model.definitions.AbstractMetadataDefinition
All Implemented Interfaces:
MetadataDefinition, Metadata<MetadataDefinition>, hudson.model.Describable<AbstractMetadataDefinition>, Serializable
Direct Known Subclasses:
DateMetadataDefinition, NumberMetadataDefinition, StringMetadataDefinition, TreeNodeMetadataDefinition

@ExportedBean
public abstract class AbstractMetadataDefinition
extends Object
implements hudson.model.Describable<AbstractMetadataDefinition>, Serializable, MetadataDefinition

A metadata definition.

See Also:
Serialized Form

Nested Class Summary
static class AbstractMetadataDefinition.AbstractMetaDataDefinitionDescriptor
          The descriptor for the AbstractMetadataDefinition.
 
Constructor Summary
AbstractMetadataDefinition(String name)
          Constructor with only a name.
AbstractMetadataDefinition(String name, String description)
          Constructor with name and description.
AbstractMetadataDefinition(String name, String description, boolean exposedToEnvironment)
          Constructor with name, description and exposedToEnvironment..
 
Method Summary
abstract  AbstractMetadataValue createValue(Object o)
          Creates an AbstractMetadataValue from this definition.
static hudson.DescriptorExtensionList<AbstractMetadataDefinition,AbstractMetadataDefinition.AbstractMetaDataDefinitionDescriptor> getAll()
          Returns all the registered AbstractMetadataDefinition descriptors.
 Object getDefaultValue()
          Returns default metadata values for this definition.
 String getDescription()
          Returns the description of this definition.
 AbstractMetadataDefinition.AbstractMetaDataDefinitionDescriptor getDescriptor()
          Returns the descriptor of this definition.
 String getFullName()
          This function will generate the full name.
 String getFullName(String separator)
          This function will generate the full name, using the chosen separator.
 String getFullNameFrom(MetadataParent<MetadataDefinition> base)
          Gives the full name.
 String[] getFullPath()
          Gives the full path as a String array..
 String getName()
          Returns the name of this metadata.
 MetadataParent getParent()
          The parent of this metadata.
 String getType()
          Returns the simple name of the class.
 Object getValue()
          Get the value.
 boolean isExposedToEnvironment()
          Returns whether or not this should be exposed to the environment.
 void setExposeToEnvironment(boolean expose)
          Set whether this should be exposed to the environment or not.
 void setParent(MetadataParent parent)
          The parent of this metadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMetadataDefinition

public AbstractMetadataDefinition(String name)
Constructor with only a name.

Parameters:
name - the name of the definition.

AbstractMetadataDefinition

public AbstractMetadataDefinition(String name,
                                  String description)
Constructor with name and description.

Parameters:
name - the name of the definition.
description - the description of the definition.

AbstractMetadataDefinition

public AbstractMetadataDefinition(String name,
                                  String description,
                                  boolean exposedToEnvironment)
Constructor with name, description and exposedToEnvironment..

Parameters:
name - the name of the definition.
description - the description of the definition.
exposedToEnvironment - If this definition should be exposed as an environment variable.
Method Detail

getType

@Exported
public String getType()
Returns the simple name of the class.

Returns:
the simple name of this class.

getName

@Exported
public String getName()
Description copied from interface: Metadata
Returns the name of this metadata.

Specified by:
getName in interface Metadata<MetadataDefinition>
Returns:
the name of this metadata.

getParent

public MetadataParent getParent()
Description copied from interface: Metadata
The parent of this metadata.

Specified by:
getParent in interface Metadata<MetadataDefinition>
Returns:
the parent.

setParent

public void setParent(MetadataParent parent)
Description copied from interface: Metadata
The parent of this metadata.

Specified by:
setParent in interface Metadata<MetadataDefinition>
Parameters:
parent - the metadata.

isExposedToEnvironment

public boolean isExposedToEnvironment()
Description copied from interface: Metadata
Returns whether or not this should be exposed to the environment.

Specified by:
isExposedToEnvironment in interface Metadata<MetadataDefinition>
Returns:
whether this should be exposed to the environment or not.

setExposeToEnvironment

public void setExposeToEnvironment(boolean expose)
Description copied from interface: Metadata
Set whether this should be exposed to the environment or not.

Specified by:
setExposeToEnvironment in interface Metadata<MetadataDefinition>
Parameters:
expose - true if this should be exposed, false if not.

getFullName

@Exported
public String getFullName(String separator)
This function will generate the full name, using the chosen separator.

Specified by:
getFullName in interface MetadataDefinition
Parameters:
separator - the separator to use.
Returns:
the full name.

getFullName

@Exported
public String getFullName()
This function will generate the full name.

Specified by:
getFullName in interface Metadata<MetadataDefinition>
Returns:
the full name.

getFullNameFrom

public String getFullNameFrom(MetadataParent<MetadataDefinition> base)
Description copied from interface: Metadata
Gives the full name.

Specified by:
getFullNameFrom in interface Metadata<MetadataDefinition>
Parameters:
base - the parent to calculate the path from.
Returns:
a dot separated path from the base up to this item.

getFullPath

public String[] getFullPath()
Description copied from interface: Metadata
Gives the full path as a String array..

Specified by:
getFullPath in interface Metadata<MetadataDefinition>
Returns:
the full name as a String array instead of a String.

getDescription

@Exported
public String getDescription()
Returns the description of this definition.

Specified by:
getDescription in interface Metadata<MetadataDefinition>
Returns:
The description of this definition.

getDescriptor

public AbstractMetadataDefinition.AbstractMetaDataDefinitionDescriptor getDescriptor()
Returns the descriptor of this definition.

Specified by:
getDescriptor in interface hudson.model.Describable<AbstractMetadataDefinition>
Returns:
the descriptor of this definition.

createValue

public abstract AbstractMetadataValue createValue(Object o)
Creates an AbstractMetadataValue from this definition. Uses the input parameter Object to create the AbstractMetadataValue.

Specified by:
createValue in interface MetadataDefinition
Parameters:
o - the value to use as input for creating the AbstractMetadataValue.
Returns:
the AbstractMetadataValue.

getDefaultValue

@Exported
public Object getDefaultValue()
Returns default metadata values for this definition.

Returns:
default metadata values or null if no defaults are available

getValue

public Object getValue()
Description copied from interface: Metadata
Get the value.

Specified by:
getValue in interface Metadata<MetadataDefinition>
Returns:
the value.

getAll

public static hudson.DescriptorExtensionList<AbstractMetadataDefinition,AbstractMetadataDefinition.AbstractMetaDataDefinitionDescriptor> getAll()
Returns all the registered AbstractMetadataDefinition descriptors.

Returns:
A DescriptorExtensionList of the descriptors.


Copyright © 2004-2013. All Rights Reserved.