Codota Logo
loci.common.xml
Code IndexAdd Codota to your IDE (free)

How to use loci.common.xml

Best Java code snippets using loci.common.xml (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: ome/formats-common

/** Parses the given XML string into a list of key/value pairs. */
public static Hashtable<String, String> parseXML(String xml)
 throws IOException
{
 MetadataHandler handler = new MetadataHandler();
 parseXML(xml, handler);
 return handler.getMetadata();
}
origin: ome/formats-common

/** Writes the specified DOM to the given output stream. */
public static void writeXML(OutputStream os, Document doc)
 throws TransformerException
{
 writeXML(os, doc, true);
}
origin: ome/formats-common

/**
 * Parses the XML contained in the given input stream into
 * using the specified XML handler.
 * Be very careful, as 'stream' <b>will</b> be closed by the SAX parser.
 */
public static void parseXML(RandomAccessInputStream stream,
 DefaultHandler handler) throws IOException
{
 parseXML((InputStream) stream, handler);
}
origin: org.openmicroscopy/ome-common

/**
 * Indents XML by the given spacing to be more readable.
 * CDATA may be indented.
 *
 * @param xml the XML string to format
 * @param spacing the number of spaces by which to indent
 * @return the formatted XML string
 * @see #indentXML(String, int, boolean)
 */
public static String indentXML(String xml, int spacing) {
 return indentXML(xml, spacing, false);
}
origin: org.openmicroscopy/ome-common

/**
 * Attempts to validate the given XML string using
 * Java's XML validation facility.
 * @param xml The XML string to validate.
 * @return whether or not validation was successful.
 */
public static boolean validateXML(String xml) {
 return validateXML(xml, null, null);
}
origin: org.openmicroscopy/ome-common

/**
 * Dumps the given OME-XML DOM tree to a string.
 * @param schemaLocation if null, no xmlns attribute will be added.
 * @param doc the {@link Document} representing the XML to be written
 * @param r the {@link Element} to use for adding the schema location
 * @return OME-XML as a string.
 */
public static String dumpXML(String schemaLocation, Document doc, Element r) {
 return dumpXML(schemaLocation, doc, r, true);
}
origin: org.openmicroscopy/ome-xml

public Document createNewDocument() {
 if (builder == null) {
  builder = XMLTools.createBuilder();
 }
 return builder.newDocument();
}
origin: org.openmicroscopy/ome-common

/**
 * Indents XML to be more readable.
 * Uses 3 spaces to indent, and may indent CDATA.
 *
 * @param xml the XML string to format
 * @return the formatted XML string
 * @see #indentXML(String, int, boolean)
 */
public static String indentXML(String xml) {
 return indentXML(xml, 3, false);
}
origin: org.openmicroscopy/ome-common

/**
 * Parses the given XML string into a list of key/value pairs.
 *
 * @param xml the {@link InputStream} representing the XML
 * @return a hashtable of key/value pairs representing the XML
 * @throws IOException if there is an error during parsing
 * @see MetadataHandler
 */
public static Hashtable<String, String> parseXML(String xml)
 throws IOException
{
 MetadataHandler handler = new MetadataHandler();
 parseXML(xml, handler);
 return handler.getMetadata();
}
origin: ome/formats-common

/**
 * Attempts to validate the given XML string using
 * Java's XML validation facility.
 * @param xml The XML string to validate.
 * @return whether or not validation was successful.
 */
public static boolean validateXML(String xml) {
 return validateXML(xml, null, null);
}
origin: ome/formats-common

/**
 * Dumps the given OME-XML DOM tree to a string.
 * @param schemaLocation if null, no xmlns attribute will be added.
 * @return OME-XML as a string.
 */
public static String dumpXML(String schemaLocation, Document doc, Element r) {
 return dumpXML(schemaLocation, doc, r, true);
}
origin: org.openmicroscopy/ome-common

/**
 * Parses the XML contained in the given input stream into
 * using the specified XML handler.
 * Be very careful, as 'stream' <b>will</b> be closed by the SAX parser.
 *
 * @param stream the {@link RandomAccessInputStream} representing the XML
 * @param handler the {@link DefaultHandler} to use for parsing
 * @throws IOException if there is an error during parsing
 */
public static void parseXML(RandomAccessInputStream stream,
 DefaultHandler handler) throws IOException
{
 parseXML((InputStream) stream, handler);
}
origin: org.openmicroscopy/ome-common

/**
 * Writes the specified DOM to the given output stream.
 *
 * @param os the {@link OutputStream} to which XML should be written
 * @param doc the {@link Document} representing the XML to write
 * @throws TransformerException if there is an error during writing
 */
public static void writeXML(OutputStream os, Document doc)
 throws TransformerException
{
 writeXML(os, doc, true);
}
origin: ome/formats-common

/** Indents XML by the given spacing to be more readable. */
public static String indentXML(String xml, int spacing) {
 return indentXML(xml, spacing, false);
}
origin: org.openmicroscopy/ome-common

/**
 * Attempts to validate the given XML string using
 * Java's XML validation facility.
 * @param xml The XML string to validate.
 * @param label String describing the type of XML being validated.
 * @return whether or not validation was successful.
 */
public static boolean validateXML(String xml, String label) {
  return validateXML(xml, label, null);
}
origin: org.openmicroscopy/ome-common

/**
 * Parses the given XML string using the specified XML handler.
 *
 * @param xml the string representing the XML
 * @param handler the {@link DefaultHandler} to use for parsing
 * @throws IOException if there is an error during parsing
 */
public static void parseXML(String xml, DefaultHandler handler)
 throws IOException
{
 parseXML(xml.getBytes(Constants.ENCODING), handler);
}
origin: ome/formats-common

/**
 * Indents XML to be more readable, avoiding any whitespace
 * injection into CDATA if the preserveCData flag is set.
 */
public static String indentXML(String xml, boolean preserveCData) {
 return indentXML(xml, 3, preserveCData);
}
origin: ome/formats-common

/**
 * Attempts to validate the given XML string using
 * Java's XML validation facility.
 * @param xml The XML string to validate.
 * @param label String describing the type of XML being validated.
 * @return whether or not validation was successful.
 */
public static boolean validateXML(String xml, String label) {
  return validateXML(xml, label, null);
}
origin: ome/formats-common

/** Indents XML to be more readable. */
public static String indentXML(String xml) {
 return indentXML(xml, 3, false);
}
origin: org.openmicroscopy/ome-common

/**
 * Indents XML to be more readable, avoiding any whitespace
 * injection into CDATA if the preserveCData flag is set.
 * Uses 3 spaces to indent.
 *
 * @param xml the XML string to format
 * @param preserveCData true if CDATA nodes should be preserved
 *                      with no indenting
 * @return the formatted XML string
 * @see #indentXML(String, int, boolean)
 */
public static String indentXML(String xml, boolean preserveCData) {
 return indentXML(xml, 3, preserveCData);
}
loci.common.xml

Most used classes

  • XMLTools
  • LSInputI
    A simple bean implementation of the LSInput interface. Entity resolvers use these instances to provi
  • MetadataHandler
    Used to retrieve key/value pairs from XML.
  • ParserErrorHandler
    Used by various XMLTools methods to handle XML parsing errors.
  • ValidationErrorHandler
    Used by validateXML to handle XML validation errors.
  • XMLTools$SchemaReader,
  • XMLTools$XMLListener
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now