Package org.eclipse.persistence.oxm

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


        try {
            XMLUnmarshaller unmarshaller = getOrm2Project().createUnmarshaller();
            if (validateORMSchema) {
                useLocalSchemaForUnmarshaller(unmarshaller, getOrm2_0Schema());
            }
            xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader1);
        } catch (Exception orm2Error) {
            try {
                XMLUnmarshaller unmarshaller = getOrm1Project().createUnmarshaller();
                if (validateORMSchema) {
                    useLocalSchemaForUnmarshaller(unmarshaller, getOrm1_0Schema());
View Full Code Here


            try {
                XMLUnmarshaller unmarshaller = getOrm1Project().createUnmarshaller();
                if (validateORMSchema) {
                    useLocalSchemaForUnmarshaller(unmarshaller, getOrm1_0Schema());
                }
                xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader2);
            } catch (Exception orm1Error) {
                try {
                    XMLUnmarshaller unmarshaller = getEclipseLinkOrmProject().createUnmarshaller();
                    if (validateORMSchema) {
                        useLocalSchemaForUnmarshaller(unmarshaller, getEclipseLinkOrmSchema());
View Full Code Here

                try {
                    XMLUnmarshaller unmarshaller = getEclipseLinkOrmProject().createUnmarshaller();
                    if (validateORMSchema) {
                        useLocalSchemaForUnmarshaller(unmarshaller, getEclipseLinkOrmSchema());
                    }
                    xmlEntityMappings = (XMLEntityMappings) unmarshaller.unmarshal(reader3);
                } catch (Exception eclipselinkError) {
                    throw ValidationException.errorParsingMappingFile(mappingFile, orm2Error, orm1Error, eclipselinkError);
                }
            }
        }
View Full Code Here

        try {
            XMLContext context = new XMLContext(getSchemaProject());
            XMLUnmarshaller unmarshaller = context.createUnmarshaller();
            unmarshaller.setEntityResolver(schemaResolverWrapper.getSchemaResolver());

            Schema schema = (Schema) unmarshaller.unmarshal(xsdSource);
            //populate Imports
            java.util.List imports = schema.getImports();
            Iterator iter = imports.iterator();
            while (iter.hasNext()) {
                Import nextImport = (Import) iter.next();
View Full Code Here

        }
        // Marshal OPM format.
        XMLContext context = new XMLContext(opmProject);
        context.getSession(Project.class).getEventManager().addListener(new MissingDescriptorListener());
        XMLUnmarshaller unmarshaller = context.createUnmarshaller();
        Project project = (Project)unmarshaller.unmarshal(document);

        // Set the project's class loader.
        if ((classLoader != null) && (project.getDatasourceLogin() != null)) {
            project.getDatasourceLogin().getDatasourcePlatform().getConversionManager().setLoader(classLoader);
        }
View Full Code Here

        // No errors occurred, unmasrshal the document which will return a
        // SessionConfigs containing 0 or more SessionConfigs and send
        // them through the factory to create actual Sessions
        XMLContext context = new XMLContext(project);
        XMLUnmarshaller unmarshaller = context.createUnmarshaller();
        SessionConfigs configs = (SessionConfigs)unmarshaller.unmarshal(document);
        SessionsFactory factory = new SessionsFactory();
        Map sessions = factory.buildSessionConfigs(configs, loader);
        for (Iterator iterator = sessions.entrySet().iterator(); iterator.hasNext(); ) {
            Map.Entry entry = (Map.Entry)iterator.next();
            // Only add the session if missing.
View Full Code Here

            if (document.getDocumentElement().getTagName().equals("sessions")) {
                // No errors occurred, unmarshal the document which will return a
                // SessionConfigs containing 0 or more SessionConfigs
                XMLContext context = new XMLContext(getProject());
                XMLUnmarshaller unmarshaller = context.createUnmarshaller();
                return (SessionConfigs)unmarshaller.unmarshal(document);
            }else{
                // 9.0.4 session.xml or invalid xml format.
              throw SessionLoaderException.InvalidSessionXML();
            }
        } else {
View Full Code Here

            if (document.getDocumentElement().getTagName().equals("toplink-sessions")) {
                // No errors occurred, unmarshal the document which will return a
                // SessionConfigs containing 0 or more SessionConfigs
                XMLContext context = new XMLContext(new XMLSessionConfigToplinkProject());
                XMLUnmarshaller unmarshaller = context.createUnmarshaller();
                return (SessionConfigs)unmarshaller.unmarshal(document);
            }else{
                // Throw the exceptions we encountered
                throw SessionLoaderException.finalException(getExceptionStore());
            }
        }
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

                DataObject optionsDataObject = (DataObject)options;
                try {
                    SDOType theType = (SDOType)optionsDataObject.get(SDOConstants.TYPE_LOAD_OPTION);
                    try{
                        if (theType != null) {
                            unmarshalledObject = anXMLUnmarshaller.unmarshal(inputSource, theType.getImplClass());
                        }else{
                            unmarshalledObject = anXMLUnmarshaller.unmarshal(inputSource);
                        }
                    } catch(XMLMarshalException xmlException){
                        handleXMLMarshalException(xmlException);              
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.