use of eu.europa.ec.inspire.schemas.ompr.x30.ProcessPropertyType in project arctic-sea by 52North.
the class ProcessPropertyTypeEncoder method encode.
@Override
public XmlObject encode(Process process, EncodingContext ex) throws EncodingException {
ProcessPropertyType ppt = ProcessPropertyType.Factory.newInstance();
ppt.setProcess(createProcess(process));
return ppt;
}
use of eu.europa.ec.inspire.schemas.ompr.x30.ProcessPropertyType in project arctic-sea by 52North.
the class ProcessTypeEncoder method createProcess.
protected ProcessType createProcess(Process process) throws EncodingException {
if (process.isSetXml()) {
XmlObject encodedObject = null;
try {
encodedObject = XmlObject.Factory.parse(process.getXml());
if (encodedObject instanceof ProcessType) {
ProcessType pt = (ProcessType) encodedObject;
checkForInspireId(pt, process);
return pt;
} else if (encodedObject instanceof ProcessDocument) {
return ((ProcessDocument) encodedObject).getProcess();
} else if (encodedObject instanceof ProcessPropertyType) {
return ((ProcessPropertyType) encodedObject).getProcess();
} else {
throw new UnsupportedEncoderInputException(this, process);
}
} catch (final XmlException xmle) {
throw new EncodingException(xmle);
}
} else {
ProcessType pt = ProcessType.Factory.newInstance();
if (!process.isSetGmlID()) {
process.setGmlId("p_" + JavaHelper.generateID(process.toString()));
}
pt.setId(process.getGmlId());
addInspireId(pt, process);
addName(pt, process);
addType(pt, process);
addDocumentation(pt, process);
addProcessParameter(pt, process);
addResponsibleParty(pt, process);
return pt;
}
}
Aggregations