Package org.geotools.xml

Examples of org.geotools.xml.Binding


                LOGGER.warning( "Could not find binding for " + property.getQName() + ", using XSAnyTypeBinding." );
                bindings.add( new XSAnyTypeBinding() );
            }

            // get hte last binding in the chain to execute
            Binding last = ((Binding) bindings.get(bindings.size() - 1));
            Class theClass = last.getType();

            if (theClass == null) {
                throw new RuntimeException("binding declares null type: " + last.getTarget());
            }

            // get the attribute properties
            int min = particle.getMinOccurs();
            int max = particle.getMaxOccurs();
View Full Code Here


                }
            }
        }

        //load the binding into the current context
        Binding binding = loader.loadBinding(bindingName, context);

        if (binding != null) {
            //add the binding
            bindings.add(binding);

            //check execution mode, if override break out
            if (binding.getExecutionMode() == Binding.OVERRIDE) {
                return false;
            }
        }

        return true;
View Full Code Here

            //also look up a binding to teh instance itself, if found it will go
            // at the bottom of the binding hierarchy
            if (component.getName() != null) {
                QName qName = new QName(component.getTargetNamespace(), component.getName());
                Binding binding = loader.loadBinding(qName, context);

                if (binding != null) {
                    //check for override
                    if (binding.getExecutionMode() == Binding.OVERRIDE) {
                        //override, clear the binding list
                        bindings.clear();
                        bindings.add(binding);
                    } else {
                        //not override, add as first
View Full Code Here

            //simulated call stack
            Stack stack = new Stack();

            //visit from bottom to top
            for (int i = 0; i < bindings.size(); i++) {
                Binding binding = (Binding) bindings.get(i);

                if (binding.getExecutionMode() == Binding.AFTER) {
                    //put on stack to execute after parent
                    stack.push(binding);

                    continue;
                }

                //execute the strategy
                visitor.visit(binding);
            }

            //unwind the call stack
            while (!stack.isEmpty()) {
                Binding binding = (Binding) stack.pop();

                visitor.visit(binding);
            }
        }
View Full Code Here

            if (object instanceof Class) {
                Class type = (Class) object;
                if (Binding.class.isAssignableFrom(type)) {
                    Constructor c = type.getConstructors()[0];
                    Object[] params = new Object[c.getParameterTypes().length];
                    Binding binding = (Binding) c.newInstance(params);
                    assertNotNull(binding.getTarget());
                    if (binding.getTarget().getNamespaceURI().equals(GML.NAMESPACE)) {
                        assertNotNull(binding.getTarget() + " has a null type", binding.getType());
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.Binding

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.