public class ReferentialIntegrityUtil extends Object
Constructor and Description |
---|
ReferentialIntegrityUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
additionalReferentialIntegrityChecks(URL crawlTarget) |
static void |
additionalReferentialIntegrityChecks(URL crawlTarget,
URL bundleURL)
Perform additional referential integrity check beside the normal check.
|
static RuleContext |
getContext()
Get the RuleContext of the target of the check.
|
static boolean |
getContextReferenceCheckFlag()
Get the contextReferenceCheck.
|
static ProblemListener |
getListener()
Get the ProblemListener of the target of the check.
|
static String |
getReferenceType()
Get the referenceType of the target of the check.
|
static URL |
getTarget()
Get the URL of the target of the check.
|
static void |
initialize(String referenceType,
URL target,
ProblemListener problemListener,
RuleContext ruleContext)
Initialize this class to ready for doing referential checks.
|
protected static void |
reportError(ProblemDefinition defn,
URL targetUrl,
int lineNumber,
int columnNumber)
Reports an error to the validation listener.
|
protected static void |
reportError(ProblemDefinition defn,
URL target,
int lineNumber,
int columnNumber,
String message)
Reports an error to the validation listener with a custom message.
|
static void |
reportLidOrLidvidReferenceToNonExistLogicalReferences()
Report a WARNING if any LID or LIDVID references does not resolve to at least one element in
the list of logical identifiers.
|
static void |
reset()
Reset this class to its initial state in case running from regression tests.
|
static void |
setContext(RuleContext ruleContext)
Get the RuleContext of the target of the check.
|
static void |
setContextReferenceCheckFlag(boolean contextReferenceCheck)
Set the contextReferenceCheck
|
static void |
setListener(ProblemListener problemListener)
Set the ProblemListener of the target of the check.
|
static void |
setReferenceType(String referenceType)
Set the referenceType of the target of the check.
|
static void |
setTarget(URL target)
Set the URL of the target of the check.
|
public static void initialize(String referenceType, URL target, ProblemListener problemListener, RuleContext ruleContext)
referenceType
- the referenceType of the target of the check: 'bundle' or 'collection'target
- the URL of the target of the checkproblemListener
- the ProblemListener of the target of the checkruleContext
- the RuleContext of the target of the checkpublic static void reset()
public static void setContextReferenceCheckFlag(boolean contextReferenceCheck)
public static boolean getContextReferenceCheckFlag()
public static URL getTarget()
public static void setTarget(URL target)
public static ProblemListener getListener()
public static void setListener(ProblemListener problemListener)
problemListener
- The ProblemListener of the target of the checkpublic static RuleContext getContext()
public static void setContext(RuleContext ruleContext)
public static String getReferenceType()
public static void setReferenceType(String referenceType)
referenceType
- the referenceType of the target of the check: 'bundle' or 'collection'public static void reportLidOrLidvidReferenceToNonExistLogicalReferences()
validationRule
- The rule of the validation, e.g. pds4.label, pds4.bundle. This value can
be null since a rule is not required within validate module.public static void additionalReferentialIntegrityChecks(URL crawlTarget)
public static void additionalReferentialIntegrityChecks(URL crawlTarget, URL bundleURL)
crawlTarget
- The URL of the target to validate for.protected static void reportError(ProblemDefinition defn, URL targetUrl, int lineNumber, int columnNumber)
defn
- the problem definitiontargetFile
- the validation target file containing the problemlineNumber
- the line number, or -1 if no line number appliescolumnNumber
- the column number, or -1 if no column number appliesprotected static void reportError(ProblemDefinition defn, URL target, int lineNumber, int columnNumber, String message)
defn
- the problem definitiontarget
- the validation target containing the problemlineNumber
- the line number, or -1 if no line number appliescolumnNumber
- the column number, or -1 if no column number appliesmessage
- the error message to reportCopyright © 2023 Jet Propulsion Laboratory, California Institute of Technology. All rights reserved.