public class FieldInfoReader
extends java.lang.Object
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?
Modifier and Type | Class and Description |
---|---|
class |
FieldInfoReader.OtherPractice
Other practices have a header and a list of "practices".
|
Modifier and Type | Field and Description |
---|---|
java.net.URI |
uri
Description of the Field
|
Constructor and Description |
---|
FieldInfoReader(java.lang.String path)
Constructor for the FieldInfoReader object
|
FieldInfoReader(java.net.URI uri)
Constructor for the FieldInfoReader object
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
applyMarkup(java.lang.String text,
java.lang.String link,
java.lang.String url,
java.lang.String style)
Apply specified markup (url, style) to the first occurrence of a substring
(link ) of the provided text.
|
void |
destroy()
Description of the Method
|
java.lang.String |
getDefinition()
Gets the definition for this field.
|
org.dom4j.Document |
getDocument()
Gets the document attribute of the FieldInfoReader object
|
java.util.List |
getDonts()
Gets the donts attribute of the FieldInfoReader object
|
java.util.List |
getDos()
Gets the dos attribute of the FieldInfoReader object
|
static java.lang.String |
getElementText(org.dom4j.Element e)
Return formatted contents for given Element, inserting hyperlink when
"link" and "url" attributes are present
|
java.util.List |
getExamples()
Gets the examples attribute of the FieldInfoReader object
|
java.lang.String |
getFormat()
Get the metadata format of the framework containing this field.
|
java.lang.String |
getName()
Get the name of the field this file documents.
|
java.util.List |
getOtherPractices()
Get the list of otherPractices specified by this fields file.
|
java.lang.String |
getPath()
Get the xpath to the field this file documents.
|
java.util.List |
getPrompts()
Gets the prompts for this field.
|
java.lang.String |
getSource()
Returns URI (as String) of the source file for this FieldInfoReader
|
java.util.List |
getTermAndDeftns(java.lang.String term)
Gets a List of
TermAndDeftn instances for specified term (usually there
is only one item in the list) |
java.util.List |
getTermList()
Gets a sorted list of vocab Terms defined by this field.
|
org.apache.struts.util.LabelValueBean[] |
getTermSelectOptions()
Build an array of terms (represented as LabelValueBean instances) to be
used in a html select object.
|
java.util.Collection |
getVocabTerms()
Gets the
TermAndDeftn instances
defined for this field. |
static java.lang.String |
replaceFirst(java.lang.String in,
java.lang.String find,
java.lang.String replace)
Replace first occurrance of exact match (case sensitive)
|
static void |
setDebug(boolean d)
Sets the debug attribute of the FieldInfoReader class
|
java.lang.String |
toString()
Debugging method.
|
public FieldInfoReader(java.lang.String path) throws java.lang.Exception
path
- Description of the Parameterjava.lang.Exception
- Description of the Exceptionpublic FieldInfoReader(java.net.URI uri) throws java.lang.Exception
uri
- Description of the Parameterjava.lang.Exception
- Description of the Exceptionpublic java.lang.String getSource()
public org.dom4j.Document getDocument()
public static void setDebug(boolean d)
d
- The new debug valuepublic java.util.List getTermAndDeftns(java.lang.String term)
TermAndDeftn
instances for specified term (usually there
is only one item in the list)term
- Description of the Parameterpublic java.util.Collection getVocabTerms()
TermAndDeftn
instances
defined for this field.public java.util.List getTermList()
public org.apache.struts.util.LabelValueBean[] getTermSelectOptions()
public java.lang.String getPath() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionpublic java.lang.String getName() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionpublic java.lang.String getFormat() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionpublic java.lang.String getDefinition()
public java.util.List getPrompts()
public java.util.List getDos()
public java.util.List getDonts()
public java.util.List getExamples()
public java.util.List getOtherPractices()
Returns a list of OtherPractice instances, each of which has a header (e.g, "No title? Do this") and a set of "pratices".
public static java.lang.String applyMarkup(java.lang.String text, java.lang.String link, java.lang.String url, java.lang.String style)
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)public static java.lang.String getElementText(org.dom4j.Element e)
e
- Description of the Parameterpublic static java.lang.String replaceFirst(java.lang.String in, java.lang.String find, java.lang.String replace)
needed to replace strings with regex pattern chars, which don't get replaced by String.replace
in
- Description of the Parameterfind
- Description of the Parameterreplace
- Description of the Parameterpublic java.lang.String toString()
toString
in class java.lang.Object
public void destroy()