Class StandardsRegistry
java.lang.Object
org.dlese.dpc.schemedit.standards.StandardsRegistry
Class to manage potentially many ASN standards documents, refered to using
AsnDocKey instances. Keys identify a standards Document uniquely, and we load each document, making no attempt to identify versions that may supercede other versions of the same standards doc.
The StandardsRegistry contains AsnDocInfo instances to represent
each loaded Standards Doc. The hierarchical structure of each ASN
Document is represented as an StandardsDocument instance. The registry
makes use of a TreeCache to cache StandardTrees and loads them when
needed, so that many standards documents can be managed.
- Author:
- Jonathan Ostwald
-
Method Summary
Modifier and TypeMethodDescriptionvoidgetAsnDocByPath(String path) Gets the asnDocByPath attribute of the StandardsRegistry objectgetDocInfo(String key) Gets the docInfo attribute of the StandardsRegistry objectReturn the AsnDocInfo's for registered standards documentsstatic StandardsRegistryGets the singleton StandardsRegistry instanceGets the key (e.g., "NSES.Science.1995.D10001D0") corresponding to provided Asn Identifier (i.e, purl) for that Standards Doc.getKeys()Gets the keys attribute of the StandardsRegistry objectGets the rejectedDocs attribute of the StandardsRegistry objectgetStandard(String asnId) Gets the standardsTree associated with the provided keyGets the standardsTree corresponding to the ASN Document having the ASN identifier (purl)getStandardsNode(String asnId) Gets the standardsNode having the provided AsnIDprotected AsnStandardsDocumentCreate a AsnStandardsDocument by reading the standards file indicated by provided key.Load all xml documents found by traversing the specified standardsDirectory recursivelystatic voidThe main program for the StandardsRegistry classFind a key for a registered standards doc that matches provided key (which may contain wildcards)matchKey(org.dlese.dpc.schemedit.standards.StandardsRegistry.DocMatchKey docMatchKey) Find a key for a registered standards doc that matches provided DocKeyMatch instance.Register a Standards Document located at specified pathvoidreport()Debugging utilitystatic voidsetDebug(boolean bool) Sets the debug attribute of the StandardsRegistry class
-
Method Details
-
getInstance
Gets the singleton StandardsRegistry instance- Returns:
- a StandardsRegistry instance
-
load
Load all xml documents found by traversing the specified standardsDirectory recursively- Parameters:
standardsDirectory- a directory containing standards Documents- Returns:
- A list of AsnDocInfo instances representing loaded docs
- Throws:
Exception- NOT YET DOCUMENTED
-
register
Register a Standards Document located at specified path- Parameters:
path- filepath of xml document to be loaded- Returns:
- DocInfo for loaded doc
- Throws:
Exception- if unable to register document.
-
getRejectedDocs
Gets the rejectedDocs attribute of the StandardsRegistry object- Returns:
- The rejectedDocs value
-
instantiateStandardsDocument
Create a AsnStandardsDocument by reading the standards file indicated by provided key.- Parameters:
key- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
getKey
Gets the key (e.g., "NSES.Science.1995.D10001D0") corresponding to provided Asn Identifier (i.e, purl) for that Standards Doc.- Parameters:
docId- full ASN Id for a standards Document- Returns:
- the key used by the registry for this document
-
getKeys
Gets the keys attribute of the StandardsRegistry object- Returns:
- The keys value
-
getAsnDocByPath
Gets the asnDocByPath attribute of the StandardsRegistry object- Parameters:
path- NOT YET DOCUMENTED- Returns:
- The asnDocByPath value
-
getDocInfo
Gets the docInfo attribute of the StandardsRegistry object- Parameters:
key- key of form "author.topic.year"- Returns:
- The docInfo value
-
getStandardsDocument
Gets the standardsTree associated with the provided key- Parameters:
key- NOT YET DOCUMENTED- Returns:
- The standardsTree value
-
getStandardsDocumentForDocId
Gets the standardsTree corresponding to the ASN Document having the ASN identifier (purl)- Parameters:
docId- ASN Purl Id- Returns:
- The standardsTree for that id
-
getStandardsNode
Gets the standardsNode having the provided AsnID- Parameters:
asnId- an ASN identifier (purl)- Returns:
- The standardsNode value
-
getStandard
-
matchKey
Find a key for a registered standards doc that matches provided key (which may contain wildcards)- Parameters:
key- key to match againsted registred doc- Returns:
- key of matching registered doc
-
matchKey
Find a key for a registered standards doc that matches provided DocKeyMatch instance.- Parameters:
docMatchKey- pattern to match against- Returns:
- matched key
-
getDocInfos
Return the AsnDocInfo's for registered standards documents- Returns:
- The asnDocuments value
-
compareWithCatDocs
public void compareWithCatDocs() -
main
The main program for the StandardsRegistry class- Parameters:
args- The command line arguments- Throws:
Exception- NOT YET DOCUMENTED
-
setDebug
public static void setDebug(boolean bool) Sets the debug attribute of the StandardsRegistry class- Parameters:
bool- The new debug value
-
report
public void report()Debugging utility
-