Package gov.nasa.pds.tools.util
Class LabelUtil
java.lang.Object
gov.nasa.pds.tools.util.LabelUtil
public class LabelUtil extends Object
Class that keep track of different Information Model (IM) versions found when parsing labels
and report a WARNING if multiple versions of the Information Model (IM) are found.
-
Constructor Summary
Constructors Constructor Description LabelUtil()
-
Method Summary
Modifier and Type Method Description static String
getIMVersion(DOMSource source, URL context)
Get the Information Model (IM) version of the label (as a DOMSource)static HashSet<String>
getInformationModelVersions()
Returns the list of IMs registered so far.static String
getLauncherURIName()
Get the name of the executable of validate.static String
getLocation()
Get the location of the label currently processing.static void
registerIMVersion(String informationModelVersion)
Register the Information Model (IM) version.static void
reportIfMoreThanOneVersion(String validationRule)
Report a WARNING if the number of unique IM versions are more than one.static void
reset()
Reset all list(s) and variables back to their default states.static void
setLauncherURIName(String launcherURIName)
Set the name of the executable of validate.static void
setLocation(String location)
Set the location of the label currently processing.static void
setReport(Report report)
Set the report to log status of labels or WARNING messages.
-
Constructor Details
-
LabelUtil
public LabelUtil()
-
-
Method Details
-
reset
public static void reset()Reset all list(s) and variables back to their default states.- Parameters:
None
-
-
setLauncherURIName
Set the name of the executable of validate.- Parameters:
launcherURIName
- The name of the executable of validate.
-
getLauncherURIName
Get the name of the executable of validate.- Parameters:
None
-- Returns:
- The name of the executable of validate.
-
setReport
Set the report to log status of labels or WARNING messages.- Parameters:
report
- The Report object.
-
registerIMVersion
Register the Information Model (IM) version.- Parameters:
informationModelVersion
- The version of the IM to register, e.g. 1.12.0.0, 1.10.0.0
-
getInformationModelVersions
Returns the list of IMs registered so far.- Returns:
- informationModelVersions the list of IMs registered: {1.12.0.0, 1.10.0.0}
-
setLocation
Set the location of the label currently processing.- Parameters:
location
- informationModelVersion The version of the IM to register, e.g. 1.12.0.0, 1.10.0.0
-
getLocation
Get the location of the label currently processing.- Returns:
- location of the label currently processing.
-
getIMVersion
Get the Information Model (IM) version of the label (as a DOMSource)- Parameters:
source
- The content of context as a DOMSource. # @param context The location of the label being parsed from- Returns:
- informationModelVersion the version of the IM
-
reportIfMoreThanOneVersion
Report a WARNING if the number of unique IM versions are more than one.- Parameters:
validationRule
- The rule of the validation, e.g. pds4.label, pds4.bundle. This value can be null since a rule is is not required within validate module.
-