Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.cdm
Class PlugIn  view PlugIn download PlugIn.java

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byorg.greenstone.gatherer.cdm.PlugIn
All Implemented Interfaces:
ArgumentContainer, java.lang.Cloneable, java.util.Collection, java.lang.Comparable, DOMProxyListEntry, java.util.List, java.util.RandomAccess, java.io.Serializable

public class PlugIn
extends java.util.ArrayList
implements ArgumentContainer, java.lang.Comparable, DOMProxyListEntry, java.io.Serializable

This class is responsible for storing information from a parsed pluginfo call in such a way that it allows easy access to parsed details for the purposes of user design and specification of plugins.


Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
private  java.lang.String description
           
private  org.w3c.dom.Element element
          The DOM Element this assigned PlugIn is modelled on.
private  boolean is_abstract
           
private  java.lang.String name
           
private  PlugIn super_plugin
          The parent PlugIn this one inherits from, if any.
 
Fields inherited from class java.util.ArrayList
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PlugIn()
          Constructor used in DOMProxyListModel initializations, and Library Level.
PlugIn(org.w3c.dom.Element element, PlugIn base_plugin)
           
 
Method Summary
 void addArgument(Argument argument)
          Method to add an argument to this base plugin.
 int compareTo(java.lang.Object object)
          Method to compare two plugins for ordering.
 DOMProxyListEntry create(org.w3c.dom.Element element)
          The assigned plugin constructor.
 boolean equals(java.lang.Object object)
          Method to determine if two plugins are equal.
 Argument getArgument(java.lang.String name)
          Method to retrieve an argument by its name.
 java.util.ArrayList getArguments(boolean include_normal, boolean include_custom)
          Retrieve all of the arguments available to this base plugin, including its super plugins arguments.
 java.lang.String getCustom()
          Method to retrieve a plugins custom argument information.
 java.lang.String getDescription()
           
 org.w3c.dom.Element getElement()
           
 java.lang.String getName()
          Method to retrieve a plugins name.
 boolean isAbstract()
           
 boolean isAssigned()
           
 boolean isSeparator()
           
 void setAssigned(boolean assigned)
           
 void setCustom(java.lang.String custom_str)
          Set the custom arguments.
 void setDescription(java.lang.String description)
          Method to set the value of desc.
 void setElement(org.w3c.dom.Element element)
           
 void setIsAbstract(boolean is_abstract)
           
 void setName(java.lang.String name)
          Method to set the value of name.
 void setSuper(PlugIn super_plugin)
          Method to set the value of the super_plugin.
 java.lang.String toString()
          Method to print out this plugin as it would appear as a command within the collection configuration file.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Field Detail

is_abstract

private boolean is_abstract

element

private org.w3c.dom.Element element
The DOM Element this assigned PlugIn is modelled on.


super_plugin

private PlugIn super_plugin
The parent PlugIn this one inherits from, if any.


description

private java.lang.String description

name

private java.lang.String name
Constructor Detail

PlugIn

public PlugIn()
Constructor used in DOMProxyListModel initializations, and Library Level.


PlugIn

public PlugIn(org.w3c.dom.Element element,
              PlugIn base_plugin)
Method Detail

addArgument

public void addArgument(Argument argument)
Method to add an argument to this base plugin. Only adds the argument if it isn't already present, and only if this is a base plugin (ie not based on DOM).


compareTo

public int compareTo(java.lang.Object object)
Method to compare two plugins for ordering.

Specified by:
compareTo in interface java.lang.Comparable

create

public DOMProxyListEntry create(org.w3c.dom.Element element)
The assigned plugin constructor.

Specified by:
create in interface DOMProxyListEntry

equals

public boolean equals(java.lang.Object object)
Method to determine if two plugins are equal.

Specified by:
equals in interface java.util.List

getArgument

public Argument getArgument(java.lang.String name)
Method to retrieve an argument by its name.


getArguments

public java.util.ArrayList getArguments(boolean include_normal,
                                        boolean include_custom)
Retrieve all of the arguments available to this base plugin, including its super plugins arguments. Some complexity is added by allowing the caller to choose whether they want normal arguments, custom arguments, or both.

Specified by:
getArguments in interface ArgumentContainer

getCustom

public java.lang.String getCustom()
Method to retrieve a plugins custom argument information. Custom arguments are defined to be those that have not got matching arguments in the base reference plugin from the library. Of course if there is no base plugin then all arguments are considered to be custom.

Specified by:
getCustom in interface ArgumentContainer

getDescription

public java.lang.String getDescription()

getElement

public org.w3c.dom.Element getElement()
Specified by:
getElement in interface DOMProxyListEntry

getName

public java.lang.String getName()
Method to retrieve a plugins name.

Specified by:
getName in interface ArgumentContainer

isAbstract

public boolean isAbstract()

isAssigned

public boolean isAssigned()
Specified by:
isAssigned in interface DOMProxyListEntry

isSeparator

public boolean isSeparator()

setAssigned

public void setAssigned(boolean assigned)
Specified by:
setAssigned in interface DOMProxyListEntry

setCustom

public void setCustom(java.lang.String custom_str)
Set the custom arguments. This turns out to be quite tricky. We must parse in the string, searching for arguments (for that we use a handy method in CollectionConfiguration). Next, for each argument, we check if we already know about it. If so we update its value, otherwise we create a new argument and assign it (must assign!).

Specified by:
setCustom in interface ArgumentContainer

setDescription

public void setDescription(java.lang.String description)
Method to set the value of desc.


setElement

public void setElement(org.w3c.dom.Element element)
Specified by:
setElement in interface DOMProxyListEntry

setIsAbstract

public void setIsAbstract(boolean is_abstract)

setName

public void setName(java.lang.String name)
Method to set the value of name.


setSuper

public void setSuper(PlugIn super_plugin)
Method to set the value of the super_plugin.


toString

public java.lang.String toString()
Method to print out this plugin as it would appear as a command within the collection configuration file.