|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jafer.record.Field
public class Field
Field Summary | |
---|---|
private org.w3c.dom.Node |
recordFragment
|
private org.w3c.dom.Node |
recordRoot
|
Constructor Summary | |
---|---|
Field(org.w3c.dom.Node recordRoot,
org.w3c.dom.Node recordFragment)
|
Method Summary | |
---|---|
private boolean |
checkAttributeValues(org.w3c.dom.Element element,
java.lang.String[] attributeProfile)
|
Field[] |
get(java.lang.String fieldName)
|
Field[] |
get(java.lang.String fieldName,
java.lang.String[] attributeProfile)
|
Field[] |
get(java.lang.String fieldName,
java.lang.String attributeName,
java.lang.String attributeValue)
|
java.lang.String |
getAllFieldData(java.lang.String delimiter)
Returns the textual content of a field and all its subfields, each separated by the delimiter/s supplied (which can be an empty string.) |
private java.lang.String |
getData(org.w3c.dom.NodeList nodeList)
|
java.lang.String |
getDataBaseName()
|
java.lang.String |
getFieldData(java.lang.String field)
Deprecated. Use get(fieldName) or getFirst(fieldName) with getAllFieldData(delimiter) to produce a more controllable result. |
java.lang.String |
getFieldData(java.lang.String field,
java.lang.String attributeName,
java.lang.String attributeValue)
|
Field |
getFirst(java.lang.String fieldName)
Returns the first occurrence of the named field. |
Field |
getFirst(java.lang.String fieldName,
java.lang.String[] attributeProfile)
Returns the first occurrence of the named field with the given attributes and values. |
Field |
getFirst(java.lang.String fieldName,
java.lang.String attributeName,
java.lang.String attributeValue)
Returns the first occurrence of the named field with the given attribute name and value. |
org.w3c.dom.NodeList |
getList(java.lang.String field)
|
java.lang.String |
getName()
|
private org.w3c.dom.NodeList |
getNamedChildren(java.lang.String name,
java.lang.String[] attributeProfile,
org.w3c.dom.Node startNode,
boolean recursive)
Returns a NodeList of all ancestor nodes with the name/s and attribute value/s supplied in attributeProfile[]. |
java.lang.String |
getRecordSchema()
|
java.lang.String |
getRecordSyntax()
|
org.w3c.dom.Node |
getRoot()
|
java.lang.String |
getValue()
Returns the textual content of the field. |
org.w3c.dom.Node |
getXML()
|
private Field[] |
toFieldArray(org.w3c.dom.NodeList nodeList)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.w3c.dom.Node recordRoot
private org.w3c.dom.Node recordFragment
Constructor Detail |
---|
public Field(org.w3c.dom.Node recordRoot, org.w3c.dom.Node recordFragment)
Method Detail |
---|
public org.w3c.dom.Node getRoot()
public org.w3c.dom.Node getXML()
public java.lang.String getRecordSyntax()
public java.lang.String getDataBaseName()
public java.lang.String getRecordSchema()
public java.lang.String getValue()
public java.lang.String getName()
public Field[] get(java.lang.String fieldName)
public Field[] get(java.lang.String fieldName, java.lang.String attributeName, java.lang.String attributeValue)
public Field[] get(java.lang.String fieldName, java.lang.String[] attributeProfile)
public Field getFirst(java.lang.String fieldName)
Searches by level-order traversal, i.e. all fields at one level before their children.
fieldName
- the name of the field to find.
public Field getFirst(java.lang.String fieldName, java.lang.String attributeName, java.lang.String attributeValue)
Searches by level-order traversal, i.e. all fields at one level before their children.
fieldName
- the name of the field to find.attributeName
- the name of the required attribute.attributeValue
- the required value of the attribute.
public Field getFirst(java.lang.String fieldName, java.lang.String[] attributeProfile)
(The attributeProfile param is a String[] containing 1 or more attribute names and the required attribute values, in the format: "nameA", "valueA", "nameB", "valueB"...)
Searches by level-order traversal, i.e. all fields at one level before their children.
fieldName
- the name of the field to find.attributeProfile
- an array of attribute name/ value pairs.
public java.lang.String getAllFieldData(java.lang.String delimiter)
Suggested use for convenience: getFirst("name").getAllFieldData(", ") which would return a concatenation of the subfield data
of the first
If only one subfield is present, no delimiter is applied.
delimiter
- the string to use as a delimiter between field and subfield contents.
private org.w3c.dom.NodeList getNamedChildren(java.lang.String name, java.lang.String[] attributeProfile, org.w3c.dom.Node startNode, boolean recursive)
name
- the name of the node/s to search for.attributeProfile
- the names and values of the required attributes.startNode
- the node whose children should be searched.recursive
- when set to false, processing will halt when the first matching node is found.
private boolean checkAttributeValues(org.w3c.dom.Element element, java.lang.String[] attributeProfile)
private Field[] toFieldArray(org.w3c.dom.NodeList nodeList)
public java.lang.String getFieldData(java.lang.String field)
get(fieldName)
or getFirst(fieldName)
with getAllFieldData(delimiter)
to produce a more controllable result.
If no field is found, an empty String is returned.
field
- the field name to search for.
public java.lang.String getFieldData(java.lang.String field, java.lang.String attributeName, java.lang.String attributeValue)
private java.lang.String getData(org.w3c.dom.NodeList nodeList)
public org.w3c.dom.NodeList getList(java.lang.String field)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |