@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { PackageSerialization serialization = null; PackageDescription description = null; while (reader.hasMoreChildren()) { reader.moveDown(); String name = getElementName(reader); if (name.equals(PackageSerializationConverter.E_PACKAGE_SERIALIZATION)) { serialization = (PackageSerialization) context.convertAnother(serialization, PackageSerialization.class); } else if (name.equals(PackageDescriptionConverter.E_PACKAGE_DESCRIPTION)) { description = (PackageDescription) context.convertAnother(description, PackageDescription.class); } reader.moveUp(); } return new PackageImpl(description, serialization); }
public String toString(HierarchicalPrettyPrinter hpp) { if (!hasHpp(description)) { hpp.appendWithIndentAndNewLine("Description: " + description); } else { hpp.appendWithIndentAndNewLine("Description:"); hpp.incrementDepth(); invokeHpp(hpp, description); hpp.decrementDepth(); } if (!hasHpp(serialization)) { hpp.appendWithIndentAndNewLine("Serialization: " + serialization); } else { hpp.appendWithIndentAndNewLine("Serialization: "); hpp.incrementDepth(); invokeHpp(hpp, serialization); hpp.decrementDepth(); } return hpp.toString(); }
@Override public IngestWorkflowState newInstance() { final InMemoryEventManager em = new InMemoryEventManager(); final AttributeSetManagerImpl asm = new AttributeSetManagerImpl(); final BusinessObjectManagerImpl bom = new BusinessObjectManagerImpl(); final IngestWorkflowStateImpl state = new IngestWorkflowStateImpl(); em.setIdService(idCreationService); state.setAttributeSetManager(asm); state.setBusinessObjectManager(bom); state.setEventManager(em); state.setPackage(new PackageImpl(new DescriptionImpl(), new SerializationImpl())); return state; }