Package net.sf.opendse.io
Class Common
java.lang.Object
net.sf.opendse.io.Common
The
Common class contains common methods for reading and writing a
Specification.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectfromString(String s) Transforms a Base64 string into an object.static Iterable<nu.xom.Element> iterable(nu.xom.Elements elements) Transforms anElementsobject into a set of iterableElementobjects.static voidsetAttributes(IAttributes e, Attributes attributes) Sets theAttributes.static ObjecttoInstance(String value, Class<?> clazz) Returns an instance of a givenClass.static StringTransforms an object into a Base64 string.
-
Constructor Details
-
Common
public Common()
-
-
Method Details
-
iterable
Transforms anElementsobject into a set of iterableElementobjects.- Parameters:
elements- the elements object- Returns:
- the iterable element objects
-
toInstance
public static Object toInstance(String value, Class<?> clazz) throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException Returns an instance of a givenClass.- Parameters:
value-clazz- the Class object- Returns:
- the instance of the given class
- Throws:
IllegalArgumentExceptionSecurityExceptionInstantiationExceptionIllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
setAttributes
Sets theAttributes.- Parameters:
e- the IAttributesattributes- the attributes to set
-
fromString
Transforms a Base64 string into an object.- Parameters:
s- the string- Returns:
- the object
- Throws:
IOException- thrown in case of an IO errorClassNotFoundException- thrown in case the class does not exist
-
toString
Transforms an object into a Base64 string.- Parameters:
o- the object- Returns:
- the string
- Throws:
IOException- thrown in case of an IO error
-