Class TCFormatUtility


  • public class TCFormatUtility
    extends java.lang.Object
    This is a utility class for converting transformation catalog into different formats.
    Version:
    $Revision $
    Author:
    prasanth@isi.edu
    • Constructor Summary

      Constructors 
      Constructor Description
      TCFormatUtility()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void addLineToText​(java.lang.StringBuffer sb, java.lang.String newIndent, java.lang.String newline, java.lang.String key, java.lang.String value)
      Convenience method to add a line to the internal textual representation.
      static void printXMLFormat​(TransformationStore tStore)
      Prints the transformations in XML format
      private static java.lang.String quote​(java.lang.String str)
      Quotes a String.
      private static java.lang.String toText​(TransformationCatalogEntry entry, java.lang.String newline, java.lang.String indent)
      Converts the transformation catalog entry object to the multi line textual representation.
      static java.lang.String toTextFormat​(TransformationStore mTCStore)
      Converts the transformations into multi line text format
      • Methods inherited from class java.lang.Object

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

      • TCFormatUtility

        public TCFormatUtility()
    • Method Detail

      • toTextFormat

        public static java.lang.String toTextFormat​(TransformationStore mTCStore)
        Converts the transformations into multi line text format
        Parameters:
        mTCStore - the transformation store
        Returns:
        the text format
      • toText

        private static java.lang.String toText​(TransformationCatalogEntry entry,
                                               java.lang.String newline,
                                               java.lang.String indent)
        Converts the transformation catalog entry object to the multi line textual representation. e.g. site wind { profile env "me" "with" profile condor "more" "test" pfn "/path/to/keg" arch "x86" os "linux" osrelease "fc" osversion "4" type "STAGEABLE" }
        Parameters:
        entry - the transformation catalog entry
        newline - the newline characters
        indent - the indentation to use
        Returns:
        the textual description
      • addLineToText

        private static void addLineToText​(java.lang.StringBuffer sb,
                                          java.lang.String newIndent,
                                          java.lang.String newline,
                                          java.lang.String key,
                                          java.lang.String value)
        Convenience method to add a line to the internal textual representation.
        Parameters:
        sb - the StringBuffer to which contents are to be added.
        newIndent - the indentation
        key - the key
        value - the value
      • quote

        private static java.lang.String quote​(java.lang.String str)
        Quotes a String.
        Parameters:
        str - the String to be quoted.
        Returns:
        quoted version
      • printXMLFormat

        public static void printXMLFormat​(TransformationStore tStore)
        Prints the transformations in XML format
        Parameters:
        tStore - the transformation store