/** * Construct a {@link NSContext} instance for the supplied element. * @param el the <code>Element</code> to gather the namespace context for * @return the <code>NSContext</code> */ public static NSContext getMyNSContext(Element el) { NSContext ns = new NSContext(); ns.register(getParentNamespaces(el)); ns.register(getMyNamespaces(el)); return ns; }
public boolean hasChangedSince(Map<File, Long> since) { Map<File, Long> snapshot = lastModified(); return !CollectionUtils.equals(snapshot, since); }
public static <C extends Observer> WatchDog<Long, C> watchFile(File file, C handler) { return new WatchDog<Long, C>(new FileMutable(file), handler); }
public static Document parse(XMLStreamReader reader) throws XMLStreamException { Document doc = newDocument(); parse(reader, doc, doc); return doc; }
public String toString() { return ObjectPrinter.toString(this, new Object[] { "byRid", _byRid, "byChannel", _byChannel }); }
public static <C extends Observer> WatchDog<Map<File, Long>, C> watchFiles(List<File> files, C handler) { return new WatchDog<Map<File, Long>, C>(new FileSetMutable(files), handler); }
/** * Simply build a map from nameValuePairs and pass it to {@link #expand(String, java.util.Map)} * * @param nameValuePairs an array containing of name, value, name, value, and so on. Null values are allowed. * @see # expand (String, java.util.Map) */ public static String expand(String uriTemplate, String... nameValuePairs) throws URIException, UnsupportedOperationException { return expand(uriTemplate, toMap(nameValuePairs)); }
public String getPrefix(String uri) { return toNSContext().getPrefix(uri); }
public String getProperty(String property) { return (String) getRootMap().get(property); }
/** * Copy with default buffer size. * * @see #copy(java.io.OutputStream, java.io.InputStream) * @see #DEFAULT_BUFFER_SIZE */ public static void copy(OutputStream dest, InputStream source) throws IOException { copy(dest, source, DEFAULT_BUFFER_SIZE); }
/** * Return the first child element of the given element. Null if no children * are found. * * @param elem Element whose child is to be returned * * @return the first child element. */ public static Element getFirstChildElement(Element elem) { return (Element) findChildByType(elem, Node.ELEMENT_NODE); }
/** * <p> * Fire the events for the current frame's prefixes into a <code>ContentHandler</code>. * </p> * @param ch the target <code>ContentHandler</code>. * @throws SAXException if the target method does. */ public void endPrefixMappings(ContentHandler ch) throws SAXException { _current.endPrefixMappings(ch); }
public boolean equals(Object o) { try { return compareTo(o) == 0; } catch (ClassCastException ce) { return false; } }
/** * Convert a GUID to it's string representation. This will return a string * of at most 32 bytes. * * @return DOCUMENTME */ public String toString() { if (guidstring == null) { guidstring = mapBytesToChars(); } return guidstring; }
/** * delegate to #init */ public void onUpdate() { init(); }
/** * @param files the property file to be loaded. The file may not exist. * But if the file exists it has to be a file (not a directory), otherwhise an IOException is thrown. Files will be loaded in the given order. * @param prefix the property prefix * @throws IOException */ public HierarchicalProperties(File[] files, String prefix) throws IOException { this.files = files; this.prefix = prefix; this.dotted_prefix = "." + prefix + "."; loadFiles(); }
/** * <p> * Push a fresh context onto the stack. This method should be called somewhere in * the body of a <code>startElement()</code>, as it represents the namespace * resolution context for the events that occur between that event and the * corresponding <code>endElement()</code>. * </p> * @see org.xml.sax.ContentHandler */ public void pushNewContext() { _current = new Frame(_current); }
/** * Return potential message associated with fault. * Null if no fault data. * @return fault message Element */ public Element getFaultMessage() { return (_faultMsg == null) ? null : _faultMsg.getElement(); }
public String toString() { return ObjectPrinter.toString(this, new Object[] { "partnerLink", partnerLink, "opName", opName, "mexId", mexId }); } }