public class DerivedDataDescriptor
extends java.lang.Object
DerivedDataChoice
-s that are specified in the derived.xml
resource file.Modifier and Type | Field and Description |
---|---|
static java.util.List |
classes
A list of String names of full class names taken from the derived.xml
<class> tags.
|
static java.lang.String |
NULL_STRING
NULL string identifier
|
Constructor and Description |
---|
DerivedDataDescriptor()
Dummy constructor for now
|
DerivedDataDescriptor(java.util.ArrayList needs,
java.lang.String id,
java.lang.String description,
java.util.ArrayList categories,
java.lang.String method,
java.lang.String formula,
java.lang.String code,
java.util.Properties properties)
Constructor for the descriptor.
|
DerivedDataDescriptor(DataContext dataContext)
Constructor used for when we create an end-user formula
|
DerivedDataDescriptor(DataContext dataContext,
java.lang.String id,
java.lang.String desc,
java.lang.String formula,
java.util.List categories)
ctor
|
DerivedDataDescriptor(DerivedDataDescriptor other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
addToChoicesSoFar(java.util.Hashtable choicesSoFar,
DataChoice dataChoice)
Add the given data choice into the Hashtable of choicesSoFar.
|
void |
clearAfterSearch()
Called by the DerivedDataChoice.getDerivedDataChoices method
after the search for the set of possible DerivedDataChoice-s
are created.
|
boolean |
equals(java.lang.Object other)
Check to see if the Object is equal to this one.
|
java.util.List |
getDataCategories()
Return the list of
DataCategory s |
DerivedDataChoice |
getDataChoice()
This creates a new DerivedDataChoice whose state is defined
by this DerivedDataDescriptor
|
NamedList |
getDataChoices(java.util.Hashtable choicesSoFar)
If the choicesSoFar map contains each parameter in any of the parameter
groups return a NamedList holding the label to be used and the
collection of dataChoices that correspond to the required parameters.
|
DataContext |
getDataContext()
Get the DataContext for this descriptor
|
static java.util.List |
getDerivedDataChoices(DataContext context,
java.util.List sourceChoices,
java.util.List descriptors)
Search through and return a list of DerivedDataChoices that can be
created from the given list of sourceChoices.
|
java.lang.String |
getDescription()
Get the description for this descriptor
|
DataCategory |
getDisplayCategory()
Return the first
DataCategory in the list of categories
that is for display purposes. |
java.lang.String |
getFormula()
Get the formula for this derived quantity
|
java.lang.String |
getId()
Get the id for this descriptor.
|
boolean |
getIsDefault()
Get whether this is a default derived quantity.
|
boolean |
getIsEndUser()
Get whether this is an end user derived quantity
|
boolean |
getIsLocalUsers()
Get whether this is a formula the user has edited
|
java.lang.String |
getJythonProcedure()
Get the Jython procedure for this derived data
|
java.lang.String |
getJythonProcedure(java.lang.String procname)
Get the Jython procedure for the specified procedure name
|
java.util.List |
getNeeds()
Get list of DerivedNeed-s
|
java.lang.String |
getOperandsCategories()
Get the OperandsCategories property.
|
protected java.util.List |
getOperandsCategoryList()
get categories for operands
|
static java.util.List |
init(DataContext dataContext,
XmlResourceCollection xrc)
Go through each xml file defined by the given XmlResourceCollection
and create the DerivedDataDescriptor-s defined in the xml.
|
void |
initForSearch()
Called by the DerivedDataChoice.getDerivedDataChoices method
before the search for the set of possible DerivedDataChoice-s
are created.
|
static void |
main(java.lang.String[] args)
Method to test
|
static java.util.List |
readClasses(org.w3c.dom.Element root)
Read in the java classes defined in any class tags
under the root.
|
static java.util.List |
readDescriptors(DataContext dataContext,
org.w3c.dom.Element root,
boolean isLocal)
Create and return a list of the DDDs that are defined by the given
xml root Element.
|
void |
setDataCategories(java.util.List categories)
Mostly used by the IntegratedDataViewer FormulaDialog when creating an
end-user formula.
|
void |
setDataContext(DataContext value)
Set the DataContext for this descriptor
|
void |
setDescription(java.lang.String value)
Set the description for this descriptor
|
void |
setFormula(java.lang.String value)
Set the formula for this derived quantity
|
void |
setId(java.lang.String value)
Set the id for this descriptor.
|
void |
setIsDefault(boolean value)
Set whether this is a default derived quantity.
|
void |
setIsEndUser(boolean value)
Set whether this is an end user derived quantity (ie, formula).
|
void |
setIsLocalUsers(boolean value)
Set whether this is a formula the user has edited
|
void |
setNeeds(java.util.List<DerivedNeed> needs)
Set the needs list
|
void |
setOperandsCategories(java.lang.String value)
Set the OperandsCategories property.
|
java.lang.String |
toString()
Return a string representation of this DerivedDataDescriptor.
|
org.w3c.dom.Element |
toXml(org.w3c.dom.Document doc)
Return the XML Element that represents this DerivedDataDescriptor
|
static java.lang.String |
toXml(java.util.List descriptors)
Create the xml representation (the derived.xml) of the given
list of DerivedDataDescriptors.
|
void |
updateDataGroups()
Update derived needs when the DataGroups change
|
public static final java.lang.String NULL_STRING
public static java.util.List classes
public DerivedDataDescriptor()
public DerivedDataDescriptor(DataContext dataContext, java.lang.String id, java.lang.String desc, java.lang.String formula, java.util.List categories)
dataContext
- context for this descriptorid
- The iddesc
- descriptionformula
- formulacategories
- List of data categoriespublic DerivedDataDescriptor(DataContext dataContext)
dataContext
- context for this descriptorpublic DerivedDataDescriptor(java.util.ArrayList needs, java.lang.String id, java.lang.String description, java.util.ArrayList categories, java.lang.String method, java.lang.String formula, java.lang.String code, java.util.Properties properties)
needs
- list of operands neededid
- identifierdescription
- long namecategories
- list of categoriesmethod
- method (may be null)formula
- formula (may be null)code
- jython code (may be null)properties
- extra propertiespublic DerivedDataDescriptor(DerivedDataDescriptor other)
other
- other instance to copy.protected java.util.List getOperandsCategoryList()
public java.util.List getNeeds()
public void setNeeds(java.util.List<DerivedNeed> needs)
needs
- The needspublic void setDataCategories(java.util.List categories)
categories
- list of categoriespublic java.util.List getDataCategories()
DataCategory
sDataCategory
s defined for this descriptor.public void initForSearch()
DerivedNeed
-spublic void clearAfterSearch()
DerivedNeed
-spublic DerivedDataChoice getDataChoice()
public NamedList getDataChoices(java.util.Hashtable choicesSoFar)
choicesSoFar
- table of choices to checkpublic org.w3c.dom.Element toXml(org.w3c.dom.Document doc)
doc
- documentpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- Object in questionpublic DataCategory getDisplayCategory()
DataCategory
in the list of categories
that is for display purposes.public java.lang.String getJythonProcedure()
null
public java.lang.String getJythonProcedure(java.lang.String procname)
procname
- procedure namepublic void setIsEndUser(boolean value)
value
- true if end userpublic boolean getIsEndUser()
public void setIsLocalUsers(boolean value)
value
- true if end user editedpublic boolean getIsLocalUsers()
public void setIsDefault(boolean value)
value
- true if defaultpublic boolean getIsDefault()
public void setFormula(java.lang.String value)
value
- formulapublic java.lang.String getFormula()
public void setId(java.lang.String value)
value
- the idpublic java.lang.String getId()
public void setDescription(java.lang.String value)
value
- the descriptionpublic java.lang.String getDescription()
public void setDataContext(DataContext value)
value
- the data contextpublic DataContext getDataContext()
public static java.util.List readDescriptors(DataContext dataContext, org.w3c.dom.Element root, boolean isLocal)
dataContext
- data contextroot
- root elementisLocal
- Is this one of the users local formulaspublic static java.util.List readClasses(org.w3c.dom.Element root)
root
- root elementpublic static java.lang.String toXml(java.util.List descriptors)
descriptors
- list of descriptors to write outpublic void updateDataGroups()
public static java.util.List init(DataContext dataContext, XmlResourceCollection xrc)
dataContext
- the data contextxrc
- the resource collection of DDDspublic static void addToChoicesSoFar(java.util.Hashtable choicesSoFar, DataChoice dataChoice)
choicesSoFar
- existing choicesdataChoice
- new choicepublic static java.util.List getDerivedDataChoices(DataContext context, java.util.List sourceChoices, java.util.List descriptors)
context
- context (the IDV)sourceChoices
- choices to searchdescriptors
- The descriptorspublic static void main(java.lang.String[] args)
args
- arguments (not used)public void setOperandsCategories(java.lang.String value)
value
- The new value for OperandsCategoriespublic java.lang.String getOperandsCategories()