it.eng.spago.cms.util
Class OperationDescriptorUtils

java.lang.Object
  extended by it.eng.spago.cms.util.OperationDescriptorUtils

public class OperationDescriptorUtils
extends java.lang.Object

Utility class which implements methods usseful to extract information from the operation sourceBean descriptor. Every cms operation is represented with a SourceBean that contains necessary information and parameters for the execution The methods allow to extract the parameters in format String, Boolean and Object.


Constructor Summary
OperationDescriptorUtils()
           
 
Method Summary
static java.lang.Boolean getBooleanAttribute(SourceBean params, java.lang.String attr)
          The method searches the attibute, specified in input, inside the SourceBean of operation description and it returns the value as a Boolean.
static java.lang.Object getObjectAttribute(SourceBean params, java.lang.String attr)
          The method searches the attibute, specified in input, inside the SourceBean of operation description and it returns the value as an Object.
static java.util.Hashtable getProperties(SourceBean params)
          The method searches the properties specified inside an operation descriptor and it returns an Hashtable containing a couple of name and CmsProperty object for each property defined.
static java.lang.String getStringAttribute(SourceBean params, java.lang.String attr)
          Searches the attibute, specified in input, inside the SourceBean of operation description and it returns the value as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationDescriptorUtils

public OperationDescriptorUtils()
Method Detail

getStringAttribute

public static java.lang.String getStringAttribute(SourceBean params,
                                                  java.lang.String attr)
Searches the attibute, specified in input, inside the SourceBean of operation description and it returns the value as a String. The attribute can be specified also with the punctual notation. If the attribute does't exist and isn't obligatory the method returns null, instead, if it's obligatory but it does not exist or its value is an empty string the method throws an exception.

Parameters:
params - SourceBean of operation description
attr - name of the attribute to search inside the SourceBean
mandatory - flag to indicate if the attribute is mandatory
Returns:
String the string value of the attribute find or null if the attribute doesn't exist and isn't mandatory
Throws:
EMFInternalError - the exception will be thrown if:
  • the attribute is mandatory but doesn't exist
  • the value of the attribute is an empty string and is mandatory

getBooleanAttribute

public static java.lang.Boolean getBooleanAttribute(SourceBean params,
                                                    java.lang.String attr)
The method searches the attibute, specified in input, inside the SourceBean of operation description and it returns the value as a Boolean. The attribute can be specified also with the punctual notation. If the attribute does't exist and isn't obligatory the method returns null, instead, if it's obligatory but it does't exist or its value is empty the method throws an exception.

Parameters:
params - SourceBean of operation description
attr - name of the attribute to search inside the SourceBean
mandatory - flag to indicate if the attribute is mandatory
Returns:
Boolean, the Boolean value of the attribute find or null if the attribute doesn't exist and isn't mandatory
Throws:
EMFInternalError - the exception will be thrown if:
  • the attribute is mandatory but doesn't exist
  • the value of the attribute is empty and is mandatory

getObjectAttribute

public static java.lang.Object getObjectAttribute(SourceBean params,
                                                  java.lang.String attr)
The method searches the attibute, specified in input, inside the SourceBean of operation description and it returns the value as an Object. The attribute can be specified also with the punctual notation. If the attribute does't exist and isn't obligatory the method returns null, instead, if it's obligatory but it does't exist the method throws an exception.

Parameters:
params - SourceBean of operation description
attr - name of the attribute to search inside the SourceBean
mandatory - flag to indicate if the attribute is mandatory
Returns:
Object the Object value of the attribute find or null if the attribute doesn't exist and isn't mandatory
Throws:
EMFInternalError - the exception will be thrown if:
  • the attribute is mandatory but doesn't exist

getProperties

public static java.util.Hashtable getProperties(SourceBean params)
The method searches the properties specified inside an operation descriptor and it returns an Hashtable containing a couple of name and CmsProperty object for each property defined.