@Nullable public <T> XNodeImpl marshall(@Nullable T bean, @Nullable SerializationContext ctx) throws SchemaException { if (bean == null) { return null; } Marshaller marshaller = specialMarshallers.get(bean.getClass()); if (marshaller != null) { return marshaller.marshal(bean, ctx); } // avoiding chatty PolyString serializations (namespace declaration + orig + norm) if (bean instanceof PolyString) { bean = (T) ((PolyString) bean).getOrig(); } else if (bean instanceof PolyStringType) { bean = (T) ((PolyStringType) bean).getOrig(); } if (bean instanceof Containerable) { return (XNodeImpl) prismContext.xnodeSerializer().context(ctx).serializeRealValue(bean, new QName("dummy")).getSubnode(); } else if (bean instanceof Enum) { return marshalEnum((Enum) bean, ctx); } else if (bean.getClass().getAnnotation(XmlType.class) != null) { return marshalXmlType(bean, ctx); } else { return marshalToPrimitive(bean, ctx); } }
EvaluateScriptResponseType sr = new EvaluateScriptResponseType(); sr.setObjectList(olt); response = prismContext.domSerializer().context(ctx).serializeAnyData(sr, ReportPort.EVALUATE_SCRIPT_RESPONSE); } else if (requestObject instanceof EvaluateAuditScriptType){ EvaluateAuditScriptType s = (EvaluateAuditScriptType) requestObject; EvaluateAuditScriptResponseType sr = new EvaluateAuditScriptResponseType(); sr.setObjectList(olt); response = prismContext.domSerializer().context(ctx).serializeAnyData(sr, ReportPort.EVALUATE_AUDIT_SCRIPT_RESPONSE); } else if (requestObject instanceof ProcessReportType){ ProcessReportType p = (ProcessReportType) requestObject; ProcessReportResponseType pr = new ProcessReportResponseType(); pr.setObjectList(olt); response = prismContext.domSerializer().context(ctx).serializeAnyData(pr, ReportPort.PROCESS_REPORT_RESPONSE); } else { throw new FaultMessage("Unsupported request type: " + requestObject);