Package org.eclipse.xsd.util

Examples of org.eclipse.xsd.util.XSDSchemaLocator


        if (schemaFile != null) {
            //schema file found, parse it and lookup the complex type
            List resolvers = Schemas.findSchemaLocationResolvers(xmlConfiguration);
            List locators = new ArrayList();
            locators.add( new XSDSchemaLocator() {
                public XSDSchema locateSchema(XSDSchema schema, String namespaceURI,
                        String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
                   
                    if ( gmlNamespace.equals( namespaceURI ) ) {
                        return gmlSchema();
View Full Code Here


  {
    super.attached(eObject);

    // we need to attach a XSDSchemaLocator in order to resolve inline schema locations
    // if there's not already one attached
    XSDSchemaLocator xsdSchemaLocator = (XSDSchemaLocator)EcoreUtil.getRegisteredAdapter(this, XSDSchemaLocator.class);
    if (xsdSchemaLocator == null)
    {
      getResourceSet().getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
    }
View Full Code Here

            if (resolver != null) {
                QName key = new QName(dependency.getNamespaceURI(), "schemaLocationResolver");
                container.registerComponentInstance(key, resolver);
            }

            XSDSchemaLocator locator = dependency.getSchemaLocator();

            if (locator != null) {
                QName key = new QName(dependency.getNamespaceURI(), "schemaLocator");
                container.registerComponentInstance(key, locator);
            }
View Full Code Here

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("looking up schema for " + conf.getNamespaceURI());
            }

            XSDSchemaLocator locator = conf.getSchemaLocator();

            if (locator == null) {
                LOGGER.fine("No schema locator for " + conf.getNamespaceURI());

                continue;
            }

            String namespaceURI = conf.getNamespaceURI();
            String schemaLocation = null;

            try {
                URL location = new URL(conf.getSchemaFileURL());
                schemaLocation = location.toExternalForm();
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("schema location: " + schemaLocation);
            }

            XSDSchema schema = locator.locateSchema(null, namespaceURI, schemaLocation, null);

            if (schema != null) {
                resolvedSchemas.add(schema);
            }
        }
View Full Code Here

        XSDImport imprt = XSDFactory.eINSTANCE.createXSDImport();
        imprt.setNamespace( importee.getTargetNamespace() );
        schema.getContents().add( imprt );
       
        List<XSDSchemaLocator> locators = new ArrayList<XSDSchemaLocator>();
        locators.add( new XSDSchemaLocator() {
            public XSDSchema locateSchema(XSDSchema xsdSchema,
                    String namespaceURI, String rawSchemaLocationURI,
                    String resolvedSchemaLocationURI) {
               
                if ( importee.getTargetNamespace().equals( namespaceURI ) ) {
View Full Code Here

                seen.add( namespace );
               
                if ( schemaLocation != null ) {
                    //look for a locator or resolver that can handle it
                    for ( Iterator l = locators.iterator(); l.hasNext(); ) {
                        XSDSchemaLocator locator = (XSDSchemaLocator) l.next();
                       
                        //check for schema locator which canHandle
                        if ( locator instanceof SchemaLocator ) {
                            if ( ((SchemaLocator)locator).canHandle(null, namespace, schemaLocation, null)) {
                                //cool, return here and do not recurse
View Full Code Here

        }

        public XSDSchema locateSchema(XSDSchema xsdSchema, String namespaceURI,
            String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
            for (int i = 0; i < locators.size(); i++) {
                XSDSchemaLocator locator = (XSDSchemaLocator) locators.get(i);
                XSDSchema schema = locator.locateSchema(xsdSchema, namespaceURI,
                        rawSchemaLocationURI, resolvedSchemaLocationURI);

                if (schema != null) {
                    return schema;
                }
View Full Code Here

        xsds.set( i , null );
      }
    }
   
    //add a schema locator which uses the xsd objects to get at the schemas
    XSDSchemaLocator locator = new XSDSchemaLocator() {

            public XSDSchema locateSchema(XSDSchema schema, String namespaceURI,
                String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
               
                for ( Iterator x = xsds.iterator(); x.hasNext(); ) {
View Full Code Here

            if (resolver != null) {
                resolvers.add(resolver);
            }
        }
       
        XSDSchemaLocator suppSchemaLocator = getSupplementarySchemaLocator();
       
        if (suppSchemaLocator != null) {
            locators.add(suppSchemaLocator);
        }
View Full Code Here

            }
           
            //schema file found, parse it and lookup the complex type
            List resolvers = Schemas.findSchemaLocationResolvers(xmlConfiguration);
            List locators = new ArrayList();
            locators.add( new XSDSchemaLocator() {
                public XSDSchema locateSchema(XSDSchema schema, String namespaceURI,
                        String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
                   
                    if ( gmlNamespace.equals( namespaceURI ) ) {
                        return gmlSchema();
View Full Code Here

TOP

Related Classes of org.eclipse.xsd.util.XSDSchemaLocator

Copyright © 2018 www.massapicom. 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.