Package org.dlese.dpc.schemedit.vocab
Class FieldInfoReader
java.lang.Object
org.dlese.dpc.schemedit.vocab.FieldInfoReader
Provides access to infomormation (beyond that expressed in the metadata
schema) about a metadata field, such as cataloging best practices and
definitions of controlled vocabulary.
FieldInfoReader reads FieldInfo xml documents and is used by org.dlese.dpc.schemedit.autoform classes as well as MetaDataFramework instances.
Note: why doesn't this class extend the AbstractConfigReader class?
- Author:
- ostwald
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassOther practices have a header and a list of "practices". -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFieldInfoReader(String path) Constructor for the FieldInfoReader objectFieldInfoReader(URI uri) Constructor for the FieldInfoReader object -
Method Summary
Modifier and TypeMethodDescriptionstatic StringapplyMarkup(String text, String link, String url, String style) Apply specified markup (url, style) to the first occurrence of a substring (link ) of the provided text.voiddestroy()Description of the MethodGets the definition for this field.org.dom4j.DocumentGets the document attribute of the FieldInfoReader objectgetDonts()Gets the donts attribute of the FieldInfoReader objectgetDos()Gets the dos attribute of the FieldInfoReader objectstatic StringgetElementText(org.dom4j.Element e) Return formatted contents for given Element, inserting hyperlink when "link" and "url" attributes are presentGets the examples attribute of the FieldInfoReader objectGet the metadata format of the framework containing this field.getName()Get the name of the field this file documents.Get the list of otherPractices specified by this fields file.getPath()Get the xpath to the field this file documents.Gets the prompts for this field.Returns URI (as String) of the source file for this FieldInfoReadergetTermAndDeftns(String term) Gets a List ofTermAndDeftninstances for specified term (usually there is only one item in the list)Gets a sorted list of vocab Terms defined by this field.org.apache.struts.util.LabelValueBean[]Build an array of terms (represented as LabelValueBean instances) to be used in a html select object.Gets theTermAndDeftninstances defined for this field.static StringreplaceFirst(String in, String find, String replace) Replace first occurrance of exact match (case sensitive)static voidsetDebug(boolean d) Sets the debug attribute of the FieldInfoReader classtoString()Debugging method.
-
Field Details
-
uri
Description of the Field
-
-
Constructor Details
-
FieldInfoReader
Constructor for the FieldInfoReader object- Parameters:
path- Description of the Parameter- Throws:
Exception- Description of the Exception
-
FieldInfoReader
Constructor for the FieldInfoReader object- Parameters:
uri- Description of the Parameter- Throws:
Exception- Description of the Exception
-
-
Method Details
-
getSource
Returns URI (as String) of the source file for this FieldInfoReader -
getDocument
public org.dom4j.Document getDocument()Gets the document attribute of the FieldInfoReader object- Returns:
- The document value
-
setDebug
public static void setDebug(boolean d) Sets the debug attribute of the FieldInfoReader class- Parameters:
d- The new debug value
-
getTermAndDeftns
Gets a List ofTermAndDeftninstances for specified term (usually there is only one item in the list)- Parameters:
term- Description of the Parameter- Returns:
- The termAndDeftn value
-
getVocabTerms
Gets theTermAndDeftninstances defined for this field.- Returns:
- The vocabTerms value
-
getTermList
Gets a sorted list of vocab Terms defined by this field.- Returns:
- The termList value
-
getTermSelectOptions
public org.apache.struts.util.LabelValueBean[] getTermSelectOptions()Build an array of terms (represented as LabelValueBean instances) to be used in a html select object.- Returns:
- The termSelectOptions value as an array of
-
getPath
Get the xpath to the field this file documents.- Returns:
- The path value
- Throws:
Exception- Description of the Exception
-
getName
Get the name of the field this file documents.- Returns:
- The name value
- Throws:
Exception- Description of the Exception
-
getFormat
Get the metadata format of the framework containing this field.- Returns:
- The format value
- Throws:
Exception- Description of the Exception
-
getDefinition
Gets the definition for this field.- Returns:
- The definition value
-
getPrompts
Gets the prompts for this field.- Returns:
- The definition value
-
getDos
Gets the dos attribute of the FieldInfoReader object- Returns:
- The dos value
-
getDonts
Gets the donts attribute of the FieldInfoReader object- Returns:
- The donts value
-
getExamples
Gets the examples attribute of the FieldInfoReader object- Returns:
- The examples value
-
getOtherPractices
Get the list of otherPractices specified by this fields file.Returns a list of OtherPractice instances, each of which has a header (e.g, "No title? Do this") and a set of "pratices".
- Returns:
- OtherPractices for this field.
-
applyMarkup
Apply specified markup (url, style) to the first occurrence of a substring (link ) of the provided text.- Parameters:
text- A string of which a substring will receive formattinglink- the substring to recieve formattingurl- if present, provides destination for link (link becomes a hyperlink to url)style- specifies the formatting to be applied to link (bold, italic, bold and italic)- Returns:
- text containing a marked-up substring
-
getElementText
Return formatted contents for given Element, inserting hyperlink when "link" and "url" attributes are present- Parameters:
e- Description of the Parameter- Returns:
- The elementText value
-
replaceFirst
Replace first occurrance of exact match (case sensitive)needed to replace strings with regex pattern chars, which don't get replaced by String.replace
- Parameters:
in- Description of the Parameterfind- Description of the Parameterreplace- Description of the Parameter- Returns:
- Description of the Return Value
-
toString
Debugging method. -
destroy
public void destroy()Description of the Method
-