|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jbbres.lib.actions.elements.ElementUtilities
public class ElementUtilities
Miscellaneous Element
utility methods.
v1.1.0:
getDescription(Class)
#newInstance(Class)
Constructor Summary | |
---|---|
ElementUtilities()
|
Method Summary | |
---|---|
static Element |
clone(Element element,
Workflow workflow)
Creates and returns a copy of the given Element . |
static boolean |
compare(Element element1,
Element element2)
Compares two elements. |
static ElementDescription<?> |
getDescription(java.lang.Class<? extends Element> elementClass)
Extracts the element description object associated to a given Element class. |
static Element |
newInstance(java.lang.Class<? extends Element> elementClass,
Workflow workflow)
Creates and returns a new instance of the element class. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElementUtilities()
Method Detail |
---|
public static boolean compare(Element element1, Element element2)
This methods returns true
if and only if:
element1
and element2
are from the same
class (element1.getClass().equals(element2.getClass())
)element1.getParameters().equals(element2.getParameters())
)
element1
- - the first elementelement2
- - the second element
true
if element1
and
element2
are from the same class and have the same
set of parameters; false
otherwise.Hashtable.equals(Object)
public static Element clone(Element element, Workflow workflow)
Element
.
This methods tries first to call the Object.clone()
if the
given element is an instance of Cloneable
and has a public
clone()
method.
If this does not succeed, the method creates a new Element
calling Element.getDescription()
.newElementInstance(workflow)
and applies the parameters associated to
the source element to the new one.
element
- - the element to cloneworkflow
- - the workflow that the clone should be associated to. The
clone will not be added to the worflow.
public static ElementDescription<?> getDescription(java.lang.Class<? extends Element> elementClass) throws java.io.IOException
Element
class.
clazz
- - the Element
class
java.io.IOException
- Signals that an I/O exception has occurred.public static Element newInstance(java.lang.Class<? extends Element> elementClass, Workflow workflow) throws java.io.IOException
elementClass
- the element classworkflow
- the workflow
java.io.IOException
- Signals that an I/O exception has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |