Package org.harctoolbox.girr
Class AdminData
java.lang.Object
org.harctoolbox.girr.AdminData
- All Implemented Interfaces:
Serializable
This class bundles a some of administrative data together.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Describes how a date/time is to be formatted, as perSimpleDateFormat
. -
Constructor Summary
ConstructorDescriptionGenerates an empty AdminData.Generates an AdminData with the source field filled with the argument given.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.Imports an XML Element into an AdminData. -
Method Summary
Modifier and TypeMethodDescriptiongetNotes()
Same as getNotes("en")Get the notes for the lanugage in the argument.getTool()
getTool2()
(package private) void
Complement the current data with the data in the argument, to the extent meaningful.(package private) static void
printIfNonempty
(StringBuilder sb, String name, Object object) (package private) static void
setAttributeIfNonNull
(Element element, String attributeName, Object object) void
void
setCreatingUser
(String creator) void
void
setCreationDate
(String date) void
void
void
setSourceIfEmpty
(String source) (package private) Element
Export the AdminData into an XML Element.toFormattedString
(String lang)
-
Field Details
-
DATE_FORMATSTRING
Describes how a date/time is to be formatted, as perSimpleDateFormat
.- See Also:
-
-
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
-
printIfNonempty
-
toElement
Export the AdminData into an XML Element.- Parameters:
doc
- Owner document- Returns:
-
toFormattedString
-
toFormattedString
-
setCreationDate
-
setCreationDate
public void setCreationDate() -
setCreatingUser
-
setCreatingUser
public void setCreatingUser() -
merge
Complement the current data with the data in the argument, to the extent meaningful.- Parameters:
mergee
- Another AdminData to be merged in.
-
getNotes
Same as getNotes("en")- Returns:
-
getNotes
Get the notes for the lanugage in the argument.- Parameters:
language
-- Returns:
-
setNotes
-
setNotes
-
getCreatingUser
- Returns:
- the creatingUser
-
getSource
- Returns:
- the source
-
setSourceIfEmpty
-
getCreationDate
- Returns:
- the creationDate
-
getTool
- Returns:
- the tool
-
getToolVersion
- Returns:
- the toolVersion
-
getTool2
- Returns:
- the tool2
-
getTool2Version
- Returns:
- the tool2Version
-
getAllNotes
- Returns:
- the notes
-