public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { final org.jdom.Element elt = (org.jdom.Element)o; this.setName (XmlQueryUtils.lookupAttributeValue(parentQuery, elt, "name")); this.setValue (XmlQueryUtils.lookupAttributeValue(parentQuery, elt, "value")); }
public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { final org.jdom.Element elt = (org.jdom.Element)o; this.setName (XmlQueryUtils.lookupAttributeValue(parentQuery, elt, "name")); this.setValue (XmlQueryUtils.lookupAttributeValue(parentQuery, elt, "value")); }
public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { this.setParentQuery(parentQuery); this.setChildren(new java.util.ArrayList()); XmlQueryUtils.initChildren (conf, parentQuery, getChildren(), (org.jdom.Element)o); }
/** * The parameter object awaited here is an instance of org.jdom.Element, * its 'name' attribute is then used as the name of the inited scope. */ public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { final org.jdom.Element elt = (org.jdom.Element)o; this.setParentQuery(parentQuery); final String name = elt.getAttributeValue("name"); final String ref = elt.getAttributeValue("ref"); //this.setName(elt.getName()); this.setName(name); //if (ref != null) // setReference(lookup(ref)); if (ref != null) { setSreference(ref); if (name == null) this.setName("ref::"+ref); } // // taking care of the children XmlQueryUtils.initChildren(conf, this, getItems(), elt); log.debug("init() n>"+name+"< r>"+ref+"<"); log.debug("init() '' children count : "+getItems().size()); }
public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { log.debug("init()"); this.setParentQuery(parentQuery); this.setChildren(new java.util.ArrayList()); XmlQueryUtils.initChildren (conf, parentQuery, getChildren(), (org.jdom.Element)o); }
/** * Takes as input a JDOM element and return true if the element or * one of its children as an attribute with a matching name and a matching * value. */ public boolean validate (final Object o) throws QueryException { final org.jdom.Element elt = (org.jdom.Element)o; java.util.Iterator it = elt.getAttributes().iterator(); while (it.hasNext()) { final org.jdom.Attribute a = (org.jdom.Attribute)it.next(); if (a.getName().matches(getName()) && a.getValue().matches(getValue())) { //log.debug("validate() returning true"); return true; } } it = elt.getChildren().iterator(); while (it.hasNext()) if (validate(it.next())) return true; //log.debug("validate() returning false"); return false; }
public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { this.setParentQuery(parentQuery); this.setChild(conf.determineQueryItem(parentQuery, o)); }
/** * Inits the query item (override). */ public void init (final QueryConfiguration conf, final Query parentQuery, final Object o) throws QueryException { super.init(conf, parentQuery, o); log.debug("init() for '"+getName()+"'"); } /* - */