Class AdminData

java.lang.Object
org.harctoolbox.girr.AdminData
All Implemented Interfaces:
Serializable

final class AdminData extends Object implements Serializable
This class bundles a some of administrative data together.
  • Field Details

  • Constructor Details

    • AdminData

      AdminData()
      Generates an empty AdminData.
    • AdminData

      AdminData(String source)
      Generates an AdminData with the source field filled with the argument given.
      Parameters:
      source - Description of the origin of the data. Typically a file, a URL, or a person.
    • AdminData

      AdminData(String creatingUser, String source, String creationDate, String tool, String toolVersion, String tool2, String tool2Version, Map<String,String> notes)
      Generates an AdminData with the fields filled out. All fields are syntax-free Strings, and may optionally be null or empty.
      Parameters:
      creatingUser - Name of creating user, as a semantic free String.
      source - Description of the origin of the data. Typically a file, a URL, or a person.
      creationDate -
      tool - Name of creating tool.
      toolVersion - Version of creating tool-
      tool2 - Name of secondary tool, if applicable.
      tool2Version - Version of secondary tool.
      notes - Comment of any kind, a map indexed by language.
    • AdminData

      AdminData(Element element) throws GirrException
      Imports an XML Element into an AdminData.
      Parameters:
      element -
      Throws:
      GirrException
  • Method Details

    • setAttributeIfNonNull

      static void setAttributeIfNonNull(Element element, String attributeName, Object object)
    • printIfNonempty

      static void printIfNonempty(StringBuilder sb, String name, Object object)
    • toElement

      Element toElement(Document doc)
      Export the AdminData into an XML Element.
      Parameters:
      doc - Owner document
      Returns:
    • toFormattedString

      public String toFormattedString(String lang)
    • toFormattedString

      public String toFormattedString()
    • setCreationDate

      public void setCreationDate(String date)
    • setCreationDate

      public void setCreationDate()
    • setCreatingUser

      public void setCreatingUser(String creator)
    • setCreatingUser

      public void setCreatingUser()
    • merge

      void merge(AdminData mergee)
      Complement the current data with the data in the argument, to the extent meaningful.
      Parameters:
      mergee - Another AdminData to be merged in.
    • getNotes

      public String getNotes()
      Same as getNotes("en")
      Returns:
    • getNotes

      public String getNotes(String language)
      Get the notes for the lanugage in the argument.
      Parameters:
      language -
      Returns:
    • setNotes

      public void setNotes(String lang, String str)
    • setNotes

      public void setNotes(String str)
    • getCreatingUser

      public String getCreatingUser()
      Returns:
      the creatingUser
    • getSource

      public String getSource()
      Returns:
      the source
    • setSourceIfEmpty

      public void setSourceIfEmpty(String source)
    • getCreationDate

      public String getCreationDate()
      Returns:
      the creationDate
    • getTool

      public String getTool()
      Returns:
      the tool
    • getToolVersion

      public String getToolVersion()
      Returns:
      the toolVersion
    • getTool2

      public String getTool2()
      Returns:
      the tool2
    • getTool2Version

      public String getTool2Version()
      Returns:
      the tool2Version
    • getAllNotes

      public Map<String,String> getAllNotes()
      Returns:
      the notes