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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
fromString
(String s) Transforms a Base64 string into an object.static Iterable
<nu.xom.Element> iterable
(nu.xom.Elements elements) Transforms anElements
object into a set of iterableElement
objects.static void
setAttributes
(IAttributes e, Attributes attributes) Sets theAttributes
.static Object
toInstance
(String value, Class<?> clazz) Returns an instance of a givenClass
.static String
Transforms an object into a Base64 string.
-
Constructor Details
-
Common
public Common()
-
-
Method Details
-
iterable
Transforms anElements
object into a set of iterableElement
objects.- 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:
IllegalArgumentException
SecurityException
InstantiationException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
-
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
-