Package org.eclipse.persistence.oxm

Examples of org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal()


        XMLEntityMappings xmlEntityMappings;
       
        try {
          XMLUnmarshaller unmarshaller = m_orm1_0Project.createUnmarshaller();
            useLocalSchemaForUnmarshaller(unmarshaller, ORM_1_0_XSD, validateORMSchema);
            xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader1);
        } catch (Exception e) {
          try {
            XMLUnmarshaller unmarshaller = m_eclipseLinkOrmProject.createUnmarshaller();
                useLocalSchemaForUnmarshaller(unmarshaller, ECLIPSELINK_ORM_XSD, validateORMSchema);
                xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader2);
View Full Code Here


            xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader1);
        } catch (Exception e) {
          try {
            XMLUnmarshaller unmarshaller = m_eclipseLinkOrmProject.createUnmarshaller();
                useLocalSchemaForUnmarshaller(unmarshaller, ECLIPSELINK_ORM_XSD, validateORMSchema);
                xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader2);
          } catch (Exception ee) {
            throw ValidationException.errorParsingMappingFile(mappingFileUrl, ee);
            }
        }
       
View Full Code Here

    public void loadXMLSchema(InputStream xrSchemaStream) {

        SchemaModelProject schemaProject = new SchemaModelProject();
        XMLContext xmlContext = new XMLContext(schemaProject);
        XMLUnmarshaller unmarshaller = xmlContext.createUnmarshaller();
        Schema schema = (Schema)unmarshaller.unmarshal(xrSchemaStream);
        NamespaceResolver nr = schema.getNamespaceResolver();
        String targetNamespace = schema.getTargetNamespace();
        nr.put(TARGET_NAMESPACE_PREFIX, targetNamespace);
        xrService.schema = schema;
        xrService.schemaNamespace = targetNamespace;
View Full Code Here

                    parser.setWhitespacePreserving(false);
                  XMLContext context = new XMLContext(p);
                  context.getSession(Project.class).getEventManager().addListener(
                    new MissingDescriptorListener());
                  XMLUnmarshaller unmarshaller = context.createUnmarshaller();
                  project = (Project)unmarshaller.unmarshal(url);
              }
            }
            catch (ValidationException validationException) {
                if (validationException.getErrorCode() == ValidationException.PROJECT_XML_NOT_FOUND) {
                    throw SessionLoaderException.failedToLoadProjectXml(projectString,
View Full Code Here

        if(getExceptionStore().isEmpty()){
            if (document.getDocumentElement().getTagName().equals("sessions")) {
                XMLContext context = new XMLContext(new XMLSessionConfigProject_11_1_1());
                XMLUnmarshaller unmarshaller = context.createUnmarshaller();
                SessionConfigs configs = (SessionConfigs)unmarshaller.unmarshal(document);
                XRSessionsFactory factory = new XRSessionsFactory();
                Map<String, Session> sessions = factory.buildSessionConfigs(configs, loader);
                for (Map.Entry<String, Session> entry : sessions.entrySet()) {
                    if (!sessionManager.getSessions().containsKey(entry.getKey())) {
                        sessionManager.addSession(entry.getKey(), entry.getValue());
View Full Code Here

        DBWSModelProject xrServiceModelProject = new DBWSModelProject();
        XMLContext xmlContext = new XMLContext(xrServiceModelProject);
        XMLUnmarshaller unmarshaller = xmlContext.createUnmarshaller();
        XRServiceModel xrServiceModel;
        try {
            xrServiceModel = (XRServiceModel)unmarshaller.unmarshal(xrServiceStream);
        }
        catch (XMLMarshalException e) {
            // something went wrong parsing the eclipselink-dbws.xml - can't recover from that
            throw new WebServiceException(DBWSException.couldNotParseDBWSFile());
        }
View Full Code Here

          sw.toString();
          wsdlInputStream.close();
            SchemaModelProject schemaProject = new SchemaModelProject();
            XMLContext xmlContext2 = new XMLContext(schemaProject);
            unmarshaller = xmlContext2.createUnmarshaller();
            Schema extendedSchema = (Schema)unmarshaller.unmarshal(new StringReader(sw.toString()));
            dbwsAdapter.setExtendedSchema(extendedSchema);
        }
        catch (Exception e) {
          // that's Ok, WSDL may not contain inline schema
        }
View Full Code Here

            Iterator fragments = ((Collection)attributeValue).iterator();
            while (fragments.hasNext()) {
                Node next = (Node)fragments.next();

                //Handle Simple Case here
                Object dataObject = unmarshaller.unmarshal(next);
                if(dataObject instanceof org.eclipse.persistence.oxm.XMLRoot) {
                    dataObject = ((XMLRoot)dataObject).getObject();
                }
                result.add(dataObject);
            }
View Full Code Here

            ((SDODataObject)domainObject).set(property, result);
        } else {
            Object result = null;
            if (!(attributeValue == null)) {
                Node value = (Node)attributeValue;
                result = unmarshaller.unmarshal(value);
            if(result instanceof org.eclipse.persistence.oxm.XMLRoot) {
                    result = ((XMLRoot)result).getObject();
                }
            }
            ((SDODataObject)domainObject).set(property, result);
View Full Code Here

        // get XMLUnmarshaller once - as we may create a new instance if this helper isDirty=true
        XMLUnmarshaller anXMLUnmarshaller = getXmlUnmarshaller();
        Object unmarshalledObject = null;
        if (options == null) {
            try {
               unmarshalledObject = anXMLUnmarshaller.unmarshal(inputSource);
            } catch(XMLMarshalException xmlException){
               handleXMLMarshalException(xmlException);              
            }
        } else {
            try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.