org.writersforge.catalan.process.workers
Class DefaultWorkerInfo

java.lang.Object
  extended byorg.writersforge.catalan.process.workers.DefaultWorkerInfo
All Implemented Interfaces:
IWorkMetadata

public class DefaultWorkerInfo
extends java.lang.Object
implements IWorkMetadata

Default implementation of IWorkerInfo.

Author:
jsheets

Constructor Summary
DefaultWorkerInfo(java.lang.String name, java.lang.String description)
          Creates a new instance of DefaultWorkerInfo with no property metadata.
DefaultWorkerInfo(java.lang.String name, java.lang.String description, PropertyInfo[] required, OptionalPropertyInfo[] optional)
          Creates a new instance of DefaultWorkerInfo with property metadata.
 
Method Summary
 java.lang.String getDescription()
          Retrieves a user-friendly description of this worker or command.
 java.lang.String getName()
          Retrieves the official name of this worker or command.
 OptionalPropertyInfo[] getOptionalProperties()
          Retrieves metadata for all optional properties for this worker.
 PropertyInfo[] getRequiredProperties()
          Retrieves metadata for all required properties for this worker.
protected  void setOptionalProperties(OptionalPropertyInfo[] info)
          Assigns metadata for all optional properties in this worker.
protected  void setRequiredProperties(PropertyInfo[] info)
          Assigns metadata for all required properties in this worker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWorkerInfo

public DefaultWorkerInfo(java.lang.String name,
                         java.lang.String description)
Creates a new instance of DefaultWorkerInfo with no property metadata.

Parameters:
name - worker name
description - worker description

DefaultWorkerInfo

public DefaultWorkerInfo(java.lang.String name,
                         java.lang.String description,
                         PropertyInfo[] required,
                         OptionalPropertyInfo[] optional)
Creates a new instance of DefaultWorkerInfo with property metadata.

Parameters:
name - worker name
description - worker description
required - metadata for all required properties
optional - metadata for all optional properties
Method Detail

setRequiredProperties

protected final void setRequiredProperties(PropertyInfo[] info)
Assigns metadata for all required properties in this worker. Safe to call inside the constructor.

Parameters:
info - property metadata

setOptionalProperties

protected final void setOptionalProperties(OptionalPropertyInfo[] info)
Assigns metadata for all optional properties in this worker. Safe to call inside the constructor.

Parameters:
info - property metadata

getName

public java.lang.String getName()
Retrieves the official name of this worker or command.

Specified by:
getName in interface IWorkMetadata
Returns:
worker name

getDescription

public java.lang.String getDescription()
Retrieves a user-friendly description of this worker or command.

Specified by:
getDescription in interface IWorkMetadata
Returns:
worker description

getRequiredProperties

public PropertyInfo[] getRequiredProperties()
Retrieves metadata for all required properties for this worker. If no required properties exist for the worker, returns an empty array.

Specified by:
getRequiredProperties in interface IWorkMetadata
Returns:
required property metadata

getOptionalProperties

public OptionalPropertyInfo[] getOptionalProperties()
Retrieves metadata for all optional properties for this worker. If no optional properties exist for the worker, returns an empty array.

Specified by:
getOptionalProperties in interface IWorkMetadata
Returns:
optional property metadata