public boolean canHandle( QName elementName, Attributes attributes, Handler handler, Handler parent) { if (Parameter.equals(elementName)) { return parent != null && "StoredQuery".equals(parent.getComponent().getName()); } return false; }
@Override public void endPrefixMapping(String prefix) throws SAXException { if (!handlers.isEmpty()) { Handler h = (Handler) handlers.peek(); h.endPrefixMapping(prefix); } }
public void startChildHandler(Handler child) { this.tree = child.getParseNode(); // this.handler = (ElementHandler) child; }
public void startChildHandler(Handler child) { // childHandlers.add(child); node.addChild(child.getParseNode()); // initialize the context for the handler if (child instanceof ElementHandler) { // get the containing type (we do this for anonymous complex types) ElementInstance childInstance = (ElementInstance) child.getComponent(); ContextInitializer initer = new ContextInitializer(childInstance, node, child.getContext()); parser.getBindingWalker() .walk(element.getElementDeclaration(), initer, container(), getContext()); } }
ElementHandler handler = (ElementHandler) parent.createChildHandler(qualifiedName); if (parent.getComponent() instanceof ElementInstance) { ElementInstance parentElement = (ElementInstance) parent.getComponent(); List childParticles = index.getChildElementParticles(parentElement.getElementDeclaration()); parent.createChildHandler( new QName("*", qualifiedName.getLocalPart()));
} else { ParseExecutor executor = new ParseExecutor(element, node, getParentHandler().getContext(), parser); executor, container(), getParentHandler().getContext()); parent.endChildHandler(this); parent.getContext().removeChildContainer(getContext());
AttributeInstance attribute = element.getAttributes()[i]; ParseExecutor executor = new ParseExecutor(attribute, null, parent.getContext(), parser); .walk(attribute.getAttributeDeclaration(), executor, parent.getContext()); ElementInitializer initer = new ElementInitializer(element, node, parent.getContext()); parser.getBindingWalker() .walk(element.getElementDeclaration(), initer, container(), parent.getContext()); setContext(new DefaultPicoContainer(parent.getContext())); parent.startChildHandler(this);
public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaces.declarePrefix(prefix, uri); if (!handlers.isEmpty()) { Handler h = (Handler) handlers.peek(); h.startPrefixMapping(prefix, uri); } }
public void startElement(QName name, Attributes attributes) throws SAXException { if (!(parent instanceof DelegatingHandler)) { parent.startChildHandler(this); } delegate.startElement(name.getNamespaceURI(), name.getLocalPart(), qname(name), attributes); }
private XSDTypeDefinition container() { // get the containing type (we do this for anonymous complex types) XSDTypeDefinition container = null; if (getParentHandler().getComponent() != null) { container = getParentHandler().getComponent().getTypeDefinition(); } return container; }
public Object getValue() { if (documentHandler != null) { return documentHandler.getParseNode().getValue(); } // grab handler on top of stack if (!handlers.isEmpty()) { Handler h = (Handler) handlers.peek(); return h.getParseNode().getValue(); } return null; }