|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.test.ObjectCollectionSerializer
public class ObjectCollectionSerializer
This class produces a JAXB serialized collection of objects and can convert such serialized data back to a list of objects.
The objects passed to this class must therefore be JAXB serializable.
This class is intended to be used in tests that need to persist the state of some object collection.
| Constructor Summary | |
|---|---|
ObjectCollectionSerializer()
|
|
| Method Summary | |
|---|---|
void |
addObject(Object o)
|
void |
addObjects(Collection<?> objects)
|
List<?> |
deserialize(InputStream inputStream)
|
List<?> |
deserialize(Reader inputReader)
|
List<?> |
deserialize(XMLStreamReader reader)
This deserializes given input stream into a list of objects. |
Set<Class<?>> |
getClasses()
Returns a set of classes of objects that are to be serialized. |
List<Object> |
getObjects()
Returns a list of objects that are added to this serializer. |
void |
serialize(OutputStream output)
Serializes the objects added to this serialize to the given output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectCollectionSerializer()
| Method Detail |
|---|
@NotNull public List<Object> getObjects()
public void addObject(@NotNull
Object o)
public void addObjects(@NotNull
Collection<?> objects)
@NotNull public Set<Class<?>> getClasses()
public void serialize(OutputStream output)
throws IOException,
JAXBException
output - the output stream to serialize to
IOException
JAXBException
public List<?> deserialize(InputStream inputStream)
throws IOException,
XMLStreamException,
ClassNotFoundException,
JAXBException
IOException
XMLStreamException
ClassNotFoundException
JAXBExceptiondeserialize(XMLStreamReader)
public List<?> deserialize(Reader inputReader)
throws IOException,
XMLStreamException,
ClassNotFoundException,
JAXBException
IOException
XMLStreamException
ClassNotFoundException
JAXBExceptiondeserialize(XMLStreamReader)
public List<?> deserialize(XMLStreamReader reader)
throws IOException,
XMLStreamException,
ClassNotFoundException,
JAXBException
This method uses the current thread's context classloader to resolve the classes of the objects to be deserialized if such classloader is set.
inputStream - the input stream to read the data from
XMLStreamException
ClassNotFoundException
JAXBException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||