Class PamParameterSet

java.lang.Object
PamModel.parametermanager.PamParameterSet

public class PamParameterSet extends Object
Description of the parameters within a class. Primarily holds a list of PamParameterDataInterface objects each describing one field in the object.
Author:
Doug Gillespie
  • Field Details

    • STANDARD_MODIFIER_EXCLUSIONS

      public static final int STANDARD_MODIFIER_EXCLUSIONS
      Standard modifiers to exclude. This is important for many classes which will tend to do crazy things such as incorporate ALL of their final fields, e.g. when a Color object is written, you'll get a million static colours and still not get the RGB you want. (Color actually got a special - may need to do this for some other types too !)
      See Also:
  • Constructor Details

    • PamParameterSet

      public PamParameterSet(Object parentObject)
      Create and empty set. Generally it's better to use one of the autoGenerate functions.
      Parameters:
      parentObject -
  • Method Details

    • autoGenerate

      @Deprecated public static PamParameterSet autoGenerate(Object parentObject)
      Deprecated.
      Automatically generate a parameter set for a class. Will include all public fields and any private or protected fields for which a getter can be found that has a similar enough name
      Parameters:
      parentObject - class to generate description for. Exception is anything that's listed in the STANDARD_MODIFIER_EXCLUSIONS list (FINAL or STATIC).
      Returns:
      Created parameter set.
    • autoGenerate

      public static PamParameterSet autoGenerate(Object parentObject, PamParameterSet.ParameterSetType parameterSetType)
      Automatically generate a parameter set for a class. Will include all public fields and any private or protected fields for which a getter can be found that has a similar enough name
      Parameters:
      parentObject - class to generate description for. Exception is anything that's listed in the STANDARD_MODIFIER_EXCLUSIONS list (FINAL or STATIC).
      Returns:
      Created parameter set.
    • autoGenerate

      public static PamParameterSet autoGenerate(Object parentObject, int excludedModifiers)
      Automatically generate a parameter set for a class. Will include all public fields and any private or protected fields for which a getter can be found that has a similar enough name so long as the fields modifiers are not included within the excludedModifiers parameter
      Parameters:
      parentObject - class to generate description for
      excludedModifiers - bitmap of modifiers for fields you want to exclude, e.g. Modifier.FINAL | Modifier.STATIC
      Returns:
      Created parameter set.
      See Also:
    • checkSpecials

      public static PamParameterSet checkSpecials(Object parentObject, int excludedModifiers)
    • put

      public void put(PamParameterData pamParam)
    • getParentObject

      public Object getParentObject()
      Returns:
      the parentObject
    • getParameterDatas

      public Hashtable<String,PamParameterData> getParameterDatas()
      Returns:
      the parameterData list
      See Also:
    • getParameterCollection

      public Collection<PamParameterData> getParameterCollection()
    • findParameterData

      public PamParameterData findParameterData(String paramName) throws FieldNotFoundException
      Find parameter data with the given name.
      Parameters:
      paramName -
      Returns:
      Throws:
      FieldNotFoundException
    • removeParameterData

      public PamParameterData removeParameterData(String paramName)
      Remove a parameter data from the set
      Parameters:
      paramName - Parameter name (name of field in the owning class)
      Returns:
      the PamParameterData associated with that parameter name from the internal hashtable, or null if the parameter was not found
    • getParameterSetType

      public PamParameterSet.ParameterSetType getParameterSetType()
      Returns:
      the parameterSetType
    • setParameterSetType

      public void setParameterSetType(PamParameterSet.ParameterSetType parameterSetType)
      Parameters:
      parameterSetType - the parameterSetType to set