|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.emn.reactiveinput.descriptor.DescriptorUtilities
This class contains useful methods for creating your own descriptor.
Constructor Summary | |
DescriptorUtilities()
|
Method Summary | |
static java.lang.String |
booleanToString(boolean b)
|
static DeviceDescriptor |
createDD(java.lang.String script)
Creates a DeviceDescriptor given its creation script. |
static DeviceDescriptor[] |
createDDDeclares(java.lang.String listScript)
Creates a group of descriptor declarations given their creation script. |
static DeviceDescriptor[] |
createDDs(java.lang.String listScript)
Creates a group of descriptors given their creation script (used by meta descriptors) |
static InDescriptor |
createID(java.lang.String script)
Creates a InDescriptor given its creation script. |
static InDescriptor[] |
createIDs(java.lang.String listScript)
Creates a group of descriptors given their creation script (used by meta descriptors) |
static OutDescriptor |
createOD(java.lang.String script)
Creates a OutDescriptor given its creation script. |
static OutDescriptor[] |
createODs(java.lang.String listScript)
Creates a group of descriptors given their creation script (used by meta descriptors) |
protected static java.lang.String |
descriptorClassToKeyword(int type,
java.lang.Class cl)
|
protected static java.lang.Class |
descriptorKeywordToClass(int type,
java.lang.String keyword)
|
static DeviceDescriptor |
getDefaultDescriptor(Device d)
Creates a default descriptor for the device d. |
static InDescriptor |
getDefaultDescriptor(In s)
Creates a default descriptor for the input slot o. |
static OutDescriptor |
getDefaultDescriptor(Out o)
Creates a default descriptor for the output slot o. |
static DeviceDescriptor |
getDefaultSignature(DeviceFolder folder,
Device device)
Returns the default signature of a device for the given folder. |
static java.lang.String |
getFullFolderName(DeviceFolder f)
Returns the full name of a folder (path+name) to use with DDFolder. |
static java.lang.String |
getScript(DeviceDescriptor desc)
Returns the creation script for the DeviceDescriptor. |
static java.lang.String |
getScript(DeviceDescriptor[] desc)
Returns the creation script for a list of DeviceDescriptors. |
static java.lang.String |
getScript(InDescriptor desc)
Returns the creation script for the InDescriptor. |
static java.lang.String |
getScript(InDescriptor[] desc)
Returns the creation script for a list of InDescriptors. |
static java.lang.String |
getScript(OutDescriptor desc)
Returns the creation script for the OutDescriptor. |
static java.lang.String |
getScript(OutDescriptor[] desc)
Returns the creation script for a list of OutDescriptors. |
static DeviceDescriptor |
getValid(DeviceDescriptor desc)
Ensures that a device descriptor is valid. |
static DeviceDescriptor[] |
getValid(DeviceDescriptor[] desc)
Returns an array of valid descriptors. |
static InDescriptor |
getValid(InDescriptor desc)
Ensures that an InDescriptor is valid. |
static InDescriptor[] |
getValid(InDescriptor[] desc)
Returns an array of valid descriptors. |
static OutDescriptor |
getValid(OutDescriptor desc)
Ensures that an OutDescriptor is valid. |
static OutDescriptor[] |
getValid(OutDescriptor[] desc)
Returns an array of valid descriptors. |
static DeviceDescriptor[] |
removeDescriptors(DeviceDescriptor[] desc,
java.lang.Class cl)
Removes all DDAny descriptors from the array. |
static boolean |
stringToBoolean(java.lang.String s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DescriptorUtilities()
Method Detail |
public static java.lang.String booleanToString(boolean b)
public static DeviceDescriptor createDD(java.lang.String script)
To retreive the class name, a "DD" prefix is added to the descriptor name and its first letter is put upper case.
If the class name is not a fully-qualified name, the "fr.emn.reactiveinput.descriptor" package is also added.
This method always returns a valid DeviceDescriptor. If the script is not valid, a DDError is returned.
public static DeviceDescriptor[] createDDDeclares(java.lang.String listScript)
public static DeviceDescriptor[] createDDs(java.lang.String listScript)
public static InDescriptor createID(java.lang.String script)
To retreive the class name, a "ID" prefix is added to the descriptor name and its first letter is put upper case.
If the class name is not a fully-qualified name, the "fr.emn.reactiveinput.descriptor" package is also added.
This method always returns a valid InDescriptor. If the script is not valid, a IDError is returned.
public static InDescriptor[] createIDs(java.lang.String listScript)
public static OutDescriptor createOD(java.lang.String script)
To retreive the class name, a "OD" prefix is added to the descriptor name and its first letter is put upper case.
If the class name is not a fully-qualified name, the "fr.emn.reactiveinput.descriptor" package is also added.
This method always returns a valid OutDescriptor. If the script is not valid, a ODError is returned.
public static OutDescriptor[] createODs(java.lang.String listScript)
public static DeviceDescriptor getDefaultDescriptor(Device d)
This descriptor includes device class, name, in and out slots. PENDING: RESTRICT DESCRIPTOR WITH ADDITIONAL DESCRIPTOR CLASSES
public static InDescriptor getDefaultDescriptor(In s)
public static OutDescriptor getDefaultDescriptor(Out o)
public static DeviceDescriptor getDefaultSignature(DeviceFolder folder, Device device)
protected static java.lang.Class descriptorKeywordToClass(int type, java.lang.String keyword)
public static java.lang.String getFullFolderName(DeviceFolder f)
public static java.lang.String getScript(DeviceDescriptor[] desc)
public static java.lang.String getScript(InDescriptor[] desc)
public static java.lang.String getScript(OutDescriptor[] desc)
public static java.lang.String getScript(DeviceDescriptor desc)
In script form, the "DD" class suffix is removed, and the first character is put lowercase.
If the descriptor belongs to fr.emn.reactiveinput.descriptor package, its single name is used. For other descriptors, the fully-qualified class name is used.
If the descriptor is initially not valid (null or getString()=null), this method returns a DDError creation script.
public static java.lang.String getScript(InDescriptor desc)
In script form, the "ID" class suffix is removed, and the first character is put lowercase.
If the descriptor belongs to fr.emn.reactiveinput.descriptor package, its single name is used. For other descriptors, the fully-qualified class name is used.
If the descriptor is initially not valid (null or getString()=null), this method returns a IDError creation script.
public static java.lang.String getScript(OutDescriptor desc)
In script form, the "OD" class suffix is removed, and the first character is put lowercase.
If the descriptor belongs to fr.emn.reactiveinput.descriptor package, its single name is used. For other descriptors, the fully-qualified class name is used.
If the descriptor is initially not valid (null or getString()=null), this method returns a ODError creation script.
protected static java.lang.String descriptorClassToKeyword(int type, java.lang.Class cl)
public static DeviceDescriptor[] getValid(DeviceDescriptor[] desc)
If the array argument is null itself, returns an empty array.
public static InDescriptor[] getValid(InDescriptor[] desc)
If the array argument is null itself, returns an empty array.
public static OutDescriptor[] getValid(OutDescriptor[] desc)
If the array argument is null itself, returns an empty array.
public static DeviceDescriptor getValid(DeviceDescriptor desc)
Returns a DDError instead if:
public static InDescriptor getValid(InDescriptor desc)
Returns a IDError instead if:
public static OutDescriptor getValid(OutDescriptor desc)
Returns a ODError instead if:
public static DeviceDescriptor[] removeDescriptors(DeviceDescriptor[] desc, java.lang.Class cl)
If nothing remains, adds a DDAny.
public static boolean stringToBoolean(java.lang.String s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |