public class VocabLayoutConfig
extends java.lang.Object
E.g.,
#getFieldsFileUri(URI, String)
.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
configPath |
protected java.util.HashMap |
map |
Constructor and Description |
---|
VocabLayoutConfig()
Constructor for the VocabLayoutConfig object
|
VocabLayoutConfig(java.io.File configIndexFile)
Constructor for the VocabLayoutConfig object
|
VocabLayoutConfig(java.lang.String configIndexPath) |
Modifier and Type | Method and Description |
---|---|
java.util.List |
getAllVocabLayout()
Gets all the VocabLayouts as a list.
|
java.util.List |
getFields()
Gets all the fields (xpaths) having VocabLayouts
|
java.net.URI |
getFieldsFileUri(java.lang.String relativePath)
Gets an absolute URI be resolving a baseUri (pointing to the groups-list file) and a relativePath.
|
java.util.Set |
getKeySet()
Gets the keySet attribute of the VocabLayoutMap object
|
VocabLayout |
getVocabLayout(java.lang.String xpath) |
boolean |
hasVocabLayout(java.lang.String xpath)
Returns true if there is a VocabLayout present for the specified xpath.
|
void |
init()
Read a listing of URIs Fields files from directoryUri and then loads each of the listed files as
VocabLayout objects, which are stored in a map.
|
static void |
main(java.lang.String[] args)
Read a set of groups files
|
protected static void |
prtln(java.lang.String s)
Output a line of text to standard out, with datestamp, if debug is set to true.
|
void |
putVocabLayout(java.lang.String xpath,
VocabLayout reader)
Add a VocabLayout to the map.
|
void |
reload()
Reload all the VocabLayouts in the map
|
void |
removeVocabLayout(java.lang.String xpath) |
static void |
setDebug(boolean d) |
java.lang.String |
toString()
Description of the Method
|
public VocabLayoutConfig()
public VocabLayoutConfig(java.lang.String configIndexPath)
public VocabLayoutConfig(java.io.File configIndexFile)
uri
- NOT YET DOCUMENTEDpublic void putVocabLayout(java.lang.String xpath, VocabLayout reader)
xpath
- Description of the Parameterreader
- Description of the Parameterpublic VocabLayout getVocabLayout(java.lang.String xpath)
public void removeVocabLayout(java.lang.String xpath)
public java.util.Set getKeySet()
public void reload() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionpublic java.util.List getAllVocabLayout()
public java.util.List getFields()
public boolean hasVocabLayout(java.lang.String xpath)
xpath
- Description of the Parameterpublic java.lang.String toString()
toString
in class java.lang.Object
public void init() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionpublic java.net.URI getFieldsFileUri(java.lang.String relativePath) throws java.lang.Exception
The first two parts of the relative path form a format, version key. E.g. for relativePath "annotation/1.0.00/fields/annotation-anno-fields-en-us.xml" the key is "annotation", "1.0.00". To form an absolute fieldsFileUri, the part of the baseUri above the key are joined with the relativePath.
Exceptions are thrown if the relativePath does not contain a key, or if the baseUri does not contain the key specified by the relativePath.
baseUri
- baseUri pointing to a fields-list filerelativePath
- a relative path containing a framework, version key and the name of the fields
file.java.lang.Exception
- if absoluteFieldsFileUri cannot be computedpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- The command line argumentsjava.lang.Exception
- Description of the Exceptionpublic static void setDebug(boolean d)
protected static void prtln(java.lang.String s)
s
- The String that will be output.