Class TranslationUnit


  • public class TranslationUnit
    extends Object
    Represents a Unit of Translation.
    • Constructor Detail

      • TranslationUnit

        public TranslationUnit()
        Creates a TU w/o an source or target defined
      • TranslationUnit

        public TranslationUnit​(TranslationUnitVariant source,
                               TranslationUnitVariant target)
        Creates a TU with the provided source and targets
        Parameters:
        source - The source of the TU
        target - The target of the TU
    • Method Detail

      • getMetadata

        public Metadata getMetadata()
        Gets the metadata or attributes for this TU
        Returns:
        The Metadata of this TU
      • setMetadata

        public void setMetadata​(Metadata metadata)
      • isSourceEmpty

        public boolean isSourceEmpty()
        Checks to see if the the source is empty
        Returns:
        true if the source is empty
      • setMetadataValue

        public void setMetadataValue​(MetadataType key,
                                     String value)
        Sets the value for a give metadata value field
        Parameters:
        key - the key for the data we want set
        value - the vlaue to set the metadata to
      • isTargetEmpty

        public boolean isTargetEmpty()
        Checks to see if the the target is empty
        Returns:
        true if the target is empty
      • getMetadataValue

        public String getMetadataValue​(MetadataType key)
        Gets the value for a give metadata value field
        Parameters:
        key - the key for the data we want
        Returns:
        the value for a give metadata value field