Class DocUtils


  • public class DocUtils
    extends java.lang.Object
    Utilities used for automatically-generated documentation.
    Since:
    27 Sep 2006
    Author:
    Mark Taylor
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String filterRef​(BasicFilter filter)
      Provides a snippet of XML which references a processing filter.
      static java.lang.String fromXhtml​(java.lang.String xhtml)
      Does minimal conversion from XHTML-like XML to SUN-friendly XML.
      static java.lang.String getXmlDescription​(uk.ac.starlink.table.Documented item)
      Returns the XML description provided by an item implementing the Documented interface, in a form suitable for insertion into the STILTS user document.
      static java.lang.String join​(java.lang.String[] lines)
      Concatenates an array of strings, appending a carriage return to each one.
      static java.lang.String listInfos​(uk.ac.starlink.table.ValueInfo[] infos)
      Returns an string listing the supplied array of metadata objects.
      static java.lang.String modeRef​(java.lang.String name)
      Provides a snippet of XML which references a named ProcessingMode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • join

        public static java.lang.String join​(java.lang.String[] lines)
        Concatenates an array of strings, appending a carriage return to each one.
        Parameters:
        lines - array of input strings
        Returns:
        one long output string
      • filterRef

        public static java.lang.String filterRef​(BasicFilter filter)
        Provides a snippet of XML which references a processing filter.
        Parameters:
        filter - processing filter
        Returns:
        filter reference
      • modeRef

        public static java.lang.String modeRef​(java.lang.String name)
        Provides a snippet of XML which references a named ProcessingMode.
        Parameters:
        name - mode name
        Returns:
        mode reference
      • listInfos

        public static java.lang.String listInfos​(uk.ac.starlink.table.ValueInfo[] infos)
        Returns an string listing the supplied array of metadata objects. The returned string should be suitable for inserting into XML text.
        Parameters:
        infos - array of infos
        Returns:
        string listing infos by name
      • getXmlDescription

        public static java.lang.String getXmlDescription​(uk.ac.starlink.table.Documented item)
                                                  throws java.io.IOException
        Returns the XML description provided by an item implementing the Documented interface, in a form suitable for insertion into the STILTS user document.

        Note the implementation of this is currently somewhat scrappy; it works on the things that it's called upon to transform during the STILTS user document build, but it may need extra work if some less constrained XHTML gets fed to it. If that becomes the case, problems should show up at TTOOLS package build/test time.

        Parameters:
        item - supplier of (XHTML-like) documentation XML
        Returns:
        SUN-compliant XML
        Throws:
        java.io.IOException
      • fromXhtml

        public static java.lang.String fromXhtml​(java.lang.String xhtml)
                                          throws java.io.IOException,
                                                 javax.xml.transform.TransformerException
        Does minimal conversion from XHTML-like XML to SUN-friendly XML. Since this works on strings, it's not intended for huge documents.
        Parameters:
        xhtml - input XHTML-like XML string, expected to be a sequence of P elements
        Returns:
        output SUN-friendly XML string
        Throws:
        java.io.IOException
        javax.xml.transform.TransformerException