protected void visit (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { String name = node.getTag(); Method m = _visitors.get(name); if (m != null) m.invoke(this, new Object[]{context, descriptor, node}); } }
public void processOrdering () { //Process the web.xml's optional <absolute-ordering> element XmlParser.Node ordering = _root.get("absolute-ordering"); if (ordering == null) return; _isOrdered = true; //If an absolute-ordering was already set, then ignore it in favor of this new one // _processor.setOrdering(new AbsoluteOrdering()); Iterator<Object> iter = ordering.iterator(); XmlParser.Node node = null; while (iter.hasNext()) { Object o = iter.next(); if (!(o instanceof XmlParser.Node)) continue; node = (XmlParser.Node) o; if (node.getTag().equalsIgnoreCase("others")) //((AbsoluteOrdering)_processor.getOrdering()).addOthers(); _ordering.add("others"); else if (node.getTag().equalsIgnoreCase("name")) //((AbsoluteOrdering)_processor.getOrdering()).add(node.toString(false,true)); _ordering.add(node.toString(false,true)); } }
public void processBefores (XmlParser.Node ordering) { //Process the <before> elements, looking for an <others/> clause and all of the <name> clauses XmlParser.Node before = ordering.get("before"); if (before == null) return; Iterator<?> iter = before.iterator(); XmlParser.Node node = null; while (iter.hasNext()) { Object o = iter.next(); if (!(o instanceof XmlParser.Node)) continue; node = (XmlParser.Node) o; if (node.getTag().equalsIgnoreCase("others")) { if (_otherType != OtherType.None) throw new IllegalStateException("Duplicate <other> clause detected in "+_xml.getURI()); _otherType = OtherType.Before; } else if (node.getTag().equalsIgnoreCase("name")) _befores.add(node.toString(false,true)); } }
public String getPath() { if (_path == null) { if (getParent() != null && getParent().getTag() != null) _path = getParent().getPath() + "/" + _tag; else _path = "/" + _tag; } return _path; }
public String getPath() { if (_path == null) { if (getParent() != null && getParent().getTag() != null) _path = getParent().getPath() + "/" + _tag; else _path = "/" + _tag; } return _path; }
public String getPath() { if (_path == null) { if (getParent() != null && getParent().getTag() != null) _path = getParent().getPath() + "/" + _tag; else _path = "/" + _tag; } return _path; }
protected void visit (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { String name = node.getTag(); Method m = _visitors.get(name); if (m != null) m.invoke(this, new Object[]{context, descriptor, node}); } }
public String getPath() { if (_path == null) { if (getParent() != null && getParent().getTag() != null) _path = getParent().getPath() + "/" + _tag; else _path = "/" + _tag; } return _path; }
protected void visit (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { String name = node.getTag(); Method m = _visitors.get(name); if (m != null) m.invoke(this, new Object[]{context, descriptor, node}); } }
public String getPath() { if (_path == null) { if (getParent() != null && getParent().getTag() != null) _path = getParent().getPath() + "/" + _tag; else _path = "/" + _tag; } return _path; }
protected void visit (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { String name = node.getTag(); Method m = _visitors.get(name); if (m != null) m.invoke(this, new Object[]{context, descriptor, node}); } }
protected void visit (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { String name = node.getTag(); Method m = _visitors.get(name); if (m != null) m.invoke(this, new Object[]{context, descriptor, node}); } }
public void saveSnippet (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { LOG.debug("save {}",node.getTag()); if (_showOrigin) _buffer.append(_origin); _buffer.append(" ").append(node.toString()).append("\n"); }
public String getPath() { if (_path == null) { if (getParent() != null && getParent().getTag() != null) _path = getParent().getPath() + "/" + _tag; else _path = "/" + _tag; } return _path; }
protected void visit (WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception { String name = node.getTag(); Method m = _visitors.get(name); if (m != null) m.invoke(this, new Object[]{context, descriptor, node}); } }
String tag = node.getTag(); out.write(tag);
continue; Node n = (Node) o; String tag = n.getTag(); if (tag != null && "set".equals(tag.toLowerCase(Locale.US))) { String aname = n.getAttribute("name");
/** * Recursively go through the entire tree starting at node. * Return the value for the first node with the name set, * e.g. [Set name="name"]value[/Set] * @param name case insensitive */ public static String getValue(Node node, String name) { String nameLC = name.toLowerCase(Locale.US); for (Object o : node) { if (!(o instanceof Node)) continue; Node n = (Node) o; String tag = n.getTag(); if (tag != null && "set".equals(tag.toLowerCase(Locale.US))) { String aname = n.getAttribute("name"); if (aname != null && aname.toLowerCase(Locale.US).equals(nameLC)) return n.toString(false); } else { String rv = getValue(n, name); if (rv != null) return rv; } } return null; }
if (o instanceof XmlParser.Node && "taglib".equals(((XmlParser.Node) o).getTag())) visitTagLib(context,descriptor, (XmlParser.Node) o);
public void processAfters (XmlParser.Node ordering) { //Process the <after> elements, look for an <others/> clause and all of the <name/> clauses XmlParser.Node after = ordering.get("after"); if (after == null) return; Iterator<?> iter = after.iterator(); XmlParser.Node node = null; while (iter.hasNext()) { Object o = iter.next(); if (!(o instanceof XmlParser.Node)) continue; node = (XmlParser.Node) o; if (node.getTag().equalsIgnoreCase("others")) { if (_otherType != OtherType.None) throw new IllegalStateException("Duplicate <other> clause detected in "+_xml.getURI()); _otherType = OtherType.After; } else if (node.getTag().equalsIgnoreCase("name")) _afters.add(node.toString(false,true)); } }