@Override public final TechnicalInterventionRequestDocument modelToXml() { Calendar calendar = Calendar.getInstance(); LocalTime localTime = new LocalTime(); Date date = null; TechnicalInterventionRequestDocument technicalInterventionRequestDoc = TechnicalInterventionRequestDocument.Factory.newInstance(); TechnicalInterventionRequestDocument.TechnicalInterventionRequest technicalInterventionRequest = technicalInterventionRequestDoc.addNewTechnicalInterventionRequest(); super.fillCommonXmlInfo(technicalInterventionRequest); int i = 0; technicalInterventionRequest.setInterventionDescription(getInterventionDescription()); if (getInterventionPlace() != null) technicalInterventionRequest.setInterventionPlace(Address.modelToXml(getInterventionPlace())); i = 0; if (getInterventionType() != null) { fr.cg95.cvq.xml.common.LocalReferentialDataType[] interventionTypeTypeTab = new fr.cg95.cvq.xml.common.LocalReferentialDataType[getInterventionType().size()]; for (LocalReferentialData object : getInterventionType()) { interventionTypeTypeTab[i++] = LocalReferentialData.modelToXml(object); } technicalInterventionRequest.setInterventionTypeArray(interventionTypeTypeTab); } technicalInterventionRequest.setOtherInterventionLabel(getOtherInterventionLabel()); return technicalInterventionRequestDoc; }
@Override public final String modelToXmlString() { TechnicalInterventionRequestDocument object = this.modelToXml(); XmlOptions opts = new XmlOptions(); opts.setSavePrettyPrint(); opts.setSavePrettyPrintIndent(4); opts.setUseDefaultNamespace(); opts.setCharacterEncoding("UTF-8"); return object.xmlText(opts); }
public static TechnicalInterventionRequest xmlToModel( TechnicalInterventionRequestDocument technicalInterventionRequestDoc) { TechnicalInterventionRequestDocument.TechnicalInterventionRequest technicalInterventionRequestXml = technicalInterventionRequestDoc.getTechnicalInterventionRequest(); Calendar calendar = Calendar.getInstance(); LocalTime localTime = new LocalTime(); List list = new ArrayList(); TechnicalInterventionRequest technicalInterventionRequest = new TechnicalInterventionRequest(); technicalInterventionRequest.fillCommonModelInfo( technicalInterventionRequest, technicalInterventionRequestXml); technicalInterventionRequest.setInterventionDescription( technicalInterventionRequestXml.getInterventionDescription()); if (technicalInterventionRequestXml.getInterventionPlace() != null) technicalInterventionRequest.setInterventionPlace( Address.xmlToModel(technicalInterventionRequestXml.getInterventionPlace())); List<fr.cg95.cvq.business.request.LocalReferentialData> interventionTypeList = new ArrayList<fr.cg95.cvq.business.request.LocalReferentialData>( technicalInterventionRequestXml.sizeOfInterventionTypeArray()); for (LocalReferentialDataType object : technicalInterventionRequestXml.getInterventionTypeArray()) { interventionTypeList.add( fr.cg95.cvq.business.request.LocalReferentialData.xmlToModel(object)); } technicalInterventionRequest.setInterventionType(interventionTypeList); technicalInterventionRequest.setOtherInterventionLabel( technicalInterventionRequestXml.getOtherInterventionLabel()); return technicalInterventionRequest; }