public class Serializer {
public static Object[] readArray(String xml) throws CastorException {
Reader reader = new StringReader(xml);
ArrayWrapper aw;
try {
aw = (ArrayWrapper)Unmarshaller.unmarshal(ArrayWrapper.class, reader);
} catch (MarshalException e) {
Logger.error(Serializer.class, e.getMessage(), e);
throw new CastorException(e.getMessage());
} catch (ValidationException e) {
Logger.error(Serializer.class, e.getMessage(), e);
throw new CastorException(e.getMessage());
}
return aw.getArray();
}