Package org.geotools.xml.schema

Examples of org.geotools.xml.schema.Schema


                return lookupElement(localName, schema, new TreeSet());
        } else {
            if (imports != null) {
                it = imports.iterator();
                while( it.hasNext() ) {
                    Schema s = (Schema) it.next();
                    String ns = s.getTargetNamespace().toString();
                    String prefixLookup = prefixCache != null ? (String) prefixCache.get(ns) : null;
                    if (prefix1 == null || prefixLookup == null || prefix1.equals(prefixLookup)) {
                        Element ct = lookupElement(localName, s, new TreeSet());
                        if (ct != null) {
                            return ct;
                        }
                    }
                }
            }
            if (includes != null) {
                it = includes.iterator();
                while( it.hasNext() ) {
                    Schema s = (Schema) it.next();
                    String ns = s.getTargetNamespace().toString();
                    String prefixLookup = prefixCache != null ? (String) prefixCache.get(ns) : null;
                    if (prefix1 == null || prefixLookup == null || prefix1.equals(prefixLookup)) {
                        Element ct = lookupElement(localName, s, new TreeSet());
                        if (ct != null) {
                            return ct;
View Full Code Here


                return lookUpGroup(localName, schema, new TreeSet());
        } else {
            if (imports != null) {
                it = imports.iterator();
                while( it.hasNext() ) {
                    Schema s = (Schema) it.next();
                    String ns = s.getTargetNamespace().toString();
                    String prefixLookup = prefixCache != null ? (String) prefixCache.get(ns) : null;
                    if (prefix1 == null || prefixLookup == null || prefix1.equals(prefixLookup)) {
                        Group ct = lookUpGroup(localName, s, new TreeSet());
                        if (ct != null) {
                            return ct;
View Full Code Here

                return lookUpAttributeGroup(localName, schema, new TreeSet());
        } else {
            if (imports != null) {
                it = imports.iterator();
                while( it.hasNext() ) {
                    Schema s = (Schema) it.next();
                    String ns = s.getTargetNamespace().toString();
                    String prefixLookup = prefixCache != null ? (String) prefixCache.get(ns) : null;
                    if (prefix1 == null || prefixLookup == null || prefix1.equals(prefixLookup)) {
                        AttributeGroup ct = lookUpAttributeGroup(localName, s, new TreeSet());
                        if (ct != null) {
                            return ct;
View Full Code Here

                return lookUpAttribute(localName, schema, new TreeSet());
        } else {
            if (imports != null) {
                it = imports.iterator();
                while( it.hasNext() ) {
                    Schema s = (Schema) it.next();
                    String ns = s.getTargetNamespace().toString();
                    String prefixLookup = prefixCache != null ? (String) prefixCache.get(ns) : null;
                    if (prefix1 == null || prefixLookup == null || prefix1.equals(prefixLookup)) {
                        Attribute ct = lookUpAttribute(localName, s, new TreeSet());
                        if (ct != null) {
                            return ct;
View Full Code Here

                    while (rd.ready()) {
                        String factoryClassName = rd.readLine().trim();

                        try {
                            Schema s = (Schema) cls[i].loadClass(factoryClassName)
                                .getDeclaredMethod("getInstance", new Class[0])
                                .invoke(null, new Object[0]);
                            schemas.put(s.getTargetNamespace(), s);
                        } catch (IllegalArgumentException e1) {
                            XSISAXHandler.logger.warning(e1.toString());
                        } catch (SecurityException e1) {
                            XSISAXHandler.logger.warning(e1.toString());
                        } catch (IllegalAccessException e1) {
View Full Code Here

            return null;
        SchemaFactory sf = getInstance();
        Iterator i = sf.schemas.values().iterator();
        List l = new LinkedList();
        while(i.hasNext()){
            Schema s = (Schema)i.next();
            if(prefix.equals(s.getPrefix()))
                l.add(s);
        }
        return (Schema[])l.toArray(new Schema[l.size()]);
    }
View Full Code Here

        return (Schema[])l.toArray(new Schema[l.size()]);
    }

   
    private synchronized Schema getRealInstance(URI targetNamespace) {
        Schema r = (Schema) schemas.get(targetNamespace);

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

                    throw new SAXException(e1);
                }
               
            }

            Schema schema = contentHandler.getSchema();
            if ((targetNamespace == null) || "".equals(targetNamespace)) {
                targetNamespace=schema.getTargetNamespace();
            }

            if( schemas.get(targetNamespace)!=null ){
                schema=merge(schema, (Schema) schemas.get(targetNamespace));
            }
            schemas.put(targetNamespace, schema);
            return schema;
        } else {
            if ( !((Schema) schemas.get(targetNamespace)).includesURI(
                        desiredSchema)) {
                Schema sh = (Schema) schemas.get(targetNamespace);
                setParser();

                XSISAXHandler contentHandler = getSAXHandler(desiredSchema);
                XSISAXHandler.setLogLevel(level);
View Full Code Here

            if ((targetNamespace == null) || "".equals(targetNamespace)) {
                targetNamespace=contentHandler.getSchema().getTargetNamespace();
            }

            Schema schema = contentHandler.getSchema();
            if( schemas.get(targetNamespace)!=null ){
                schema=merge(schema, (Schema) schemas.get(targetNamespace));
            }
           
            schemas.put(targetNamespace, schema);

        } else {
            Schema sh = (Schema) schemas.get(targetNamespace);
            XSISAXHandler contentHandler = parseSchema(is1, level);

            sh = merge(sh, contentHandler.getSchema());
            schemas.put(targetNamespace, sh); // over-write
        }
View Full Code Here

        logger.finest("Target == '" + targ + "'");
        logger.finest("URI == '" + uri + "'");

        try {
            URI tns = new URI(targ);
            Schema s = SchemaFactory.getInstance(tns, uri, logger.getLevel());

            if (s != null) {
                if ((prefix == null) || "".equalsIgnoreCase(prefix)) {
                    defaultNS = s.getTargetNamespace();
                }

                targSchemas.put(s.getTargetNamespace(), s);
                prefixURIs.put(prefix, tns);
            }else{
                prefixURIs.put(prefix, tns);
            }
        } catch (URISyntaxException e) {
View Full Code Here

TOP

Related Classes of org.geotools.xml.schema.Schema

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.