public class StandardsRegistry
extends java.lang.Object
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.
Modifier and Type | Method and Description |
---|---|
void |
compareWithCatDocs() |
AsnDocInfo |
getAsnDocByPath(java.lang.String path)
Gets the asnDocByPath attribute of the StandardsRegistry object
|
AsnDocInfo |
getDocInfo(java.lang.String key)
Gets the docInfo attribute of the StandardsRegistry object
|
java.util.List |
getDocInfos()
Return the AsnDocInfo's for registered standards documents
|
static StandardsRegistry |
getInstance()
Gets the singleton StandardsRegistry instance
|
java.lang.String |
getKey(java.lang.String docId)
Gets the key (e.g., "NSES.Science.1995.D10001D0") corresponding to provided Asn
Identifier (i.e, purl) for that Standards Doc.
|
java.util.Set |
getKeys()
Gets the keys attribute of the StandardsRegistry object
|
java.util.List |
getRejectedDocs()
Gets the rejectedDocs attribute of the StandardsRegistry object
|
AsnStandard |
getStandard(java.lang.String asnId) |
AsnStandardsDocument |
getStandardsDocument(java.lang.String key)
Gets the standardsTree associated with the provided key
|
AsnStandardsDocument |
getStandardsDocumentForDocId(java.lang.String docId)
Gets the standardsTree corresponding to the ASN Document having the ASN
identifier (purl)
|
AsnStandardsNode |
getStandardsNode(java.lang.String asnId)
Gets the standardsNode having the provided AsnID
|
protected AsnStandardsDocument |
instantiateStandardsDocument(java.lang.String key)
Create a AsnStandardsDocument by reading the standards file indicated by
provided key.
|
java.util.List |
load(java.lang.String standardsDirectory)
Load all xml documents found by traversing the specified standardsDirectory
recursively
|
static void |
main(java.lang.String[] args)
The main program for the StandardsRegistry class
|
java.lang.String |
matchKey(org.dlese.dpc.schemedit.standards.StandardsRegistry.DocMatchKey docMatchKey)
Find a key for a registered standards doc that matches provided DocKeyMatch instance.
|
java.lang.String |
matchKey(java.lang.String key)
Find a key for a registered standards doc that matches provided key (which may contain wildcards)
|
AsnDocInfo |
register(java.lang.String path)
Register a Standards Document located at specified path
|
void |
report()
Debugging utility
|
static void |
setDebug(boolean bool)
Sets the debug attribute of the StandardsRegistry class
|
public static StandardsRegistry getInstance()
public java.util.List load(java.lang.String standardsDirectory) throws java.lang.Exception
standardsDirectory
- a directory containing standards Documentsjava.lang.Exception
- NOT YET DOCUMENTEDpublic AsnDocInfo register(java.lang.String path) throws java.lang.Exception
path
- filepath of xml document to be loadedjava.lang.Exception
- if unable to register document.public java.util.List getRejectedDocs()
protected AsnStandardsDocument instantiateStandardsDocument(java.lang.String key) throws java.lang.Exception
key
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic java.lang.String getKey(java.lang.String docId)
docId
- full ASN Id for a standards Documentpublic java.util.Set getKeys()
public AsnDocInfo getAsnDocByPath(java.lang.String path)
path
- NOT YET DOCUMENTEDpublic AsnDocInfo getDocInfo(java.lang.String key)
key
- key of form "author.topic.year"public AsnStandardsDocument getStandardsDocument(java.lang.String key)
key
- NOT YET DOCUMENTEDpublic AsnStandardsDocument getStandardsDocumentForDocId(java.lang.String docId)
docId
- ASN Purl Idpublic AsnStandardsNode getStandardsNode(java.lang.String asnId)
asnId
- an ASN identifier (purl)public AsnStandard getStandard(java.lang.String asnId)
public java.lang.String matchKey(java.lang.String key)
key
- key to match againsted registred docpublic java.lang.String matchKey(org.dlese.dpc.schemedit.standards.StandardsRegistry.DocMatchKey docMatchKey)
docMatchKey
- pattern to match againstpublic java.util.List getDocInfos()
public void compareWithCatDocs()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- The command line argumentsjava.lang.Exception
- NOT YET DOCUMENTEDpublic static void setDebug(boolean bool)
bool
- The new debug valuepublic void report()