de.lehmannet.om
Class Finding

java.lang.Object
  extended by de.lehmannet.om.SchemaElement
      extended by de.lehmannet.om.Finding
All Implemented Interfaces:
IExtendableSchemaElement, IFinding, ISchemaElement
Direct Known Subclasses:
GenericFinding

public abstract class Finding
extends SchemaElement
implements IFinding

The abstract class Finding provides some common features that may be used by the subclasses of an de.lehmannet.om.IFinding.
The Finding class stores a description of the findings and provides simple access to this description field. It also implements a basic XML DOM helper method that may be used by all subclasses that have to implement the IFinding interface.

Since:
1.0
Author:
doergn@users.sourceforge.net

Field Summary
 
Fields inherited from interface de.lehmannet.om.IFinding
XML_ELEMENT_ATTRIBUTE_LANGUAGE, XML_ELEMENT_DESCRIPTION, XML_ELEMENT_FINDING
 
Fields inherited from interface de.lehmannet.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Fields inherited from interface de.lehmannet.om.IExtendableSchemaElement
XML_XSI_TYPE
 
Constructor Summary
protected Finding(org.w3c.dom.Node findingElement)
          Protected constructor used by subclasses construction.
protected Finding(java.lang.String description)
          Protected constructor used by subclasses construction.
protected Finding(java.lang.String ID, java.lang.String description)
          Protected constructor used by subclasses construction.
 
Method Summary
abstract  org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
          Adds the Finding to an given parent XML DOM Element.
protected  org.w3c.dom.Element createXmlFindingElement(org.w3c.dom.Element parent)
          Creates an XML DOM Element for the Finding.
 java.lang.String getDescription()
          Returns the description of the Finding.
 java.lang.String getLanguage()
          Returns the language in which this session is described as ISO language string.
 void setDescription(java.lang.String description)
          Sets the description of the Finding.
 void setLanguage(java.lang.String language)
          Sets the language in which this finding is described.
 void setSeen(boolean seen)
          Set to true if the target was seen by the observer.
 boolean wasSeen()
          Returns true if the target was seen with this finding or not.
 
Methods inherited from class de.lehmannet.om.SchemaElement
equals, getDisplayName, getID, setID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lehmannet.om.ISchemaElement
getDisplayName, getID
 
Methods inherited from interface de.lehmannet.om.IExtendableSchemaElement
getXSIType
 

Constructor Detail

Finding

protected Finding(org.w3c.dom.Node findingElement)
           throws SchemaException
Protected constructor used by subclasses construction.

Parameters:
findingElement - The XML Node representing this Finding
Throws:
SchemaException - if the XML element is malformed

Finding

protected Finding(java.lang.String ID,
                  java.lang.String description)
           throws java.lang.IllegalArgumentException
Protected constructor used by subclasses construction.

Parameters:
ID - This elements unique ID
description - The description of the finding
Throws:
java.lang.IllegalArgumentException - if description was null

Finding

protected Finding(java.lang.String description)
           throws java.lang.IllegalArgumentException
Protected constructor used by subclasses construction.

Parameters:
description - The description of the finding
Throws:
java.lang.IllegalArgumentException - if description was null
Method Detail

addToXmlElement

public abstract org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
Adds the Finding to an given parent XML DOM Element. This abstract method is derived from de.lehmannet.om.IFinding.

Specified by:
addToXmlElement in interface IFinding
Parameters:
parent - The parent element for the Finding
Returns:
Returns the Element given as parameter with the Finding as child Element.
See Also:
Element, IFinding

getDescription

public java.lang.String getDescription()
Returns the description of the Finding. The string describes the impressions the observer had during the observation of an object.

Specified by:
getDescription in interface IFinding
Returns:
The description of the finding.

setDescription

public void setDescription(java.lang.String description)
                    throws java.lang.IllegalArgumentException
Sets the description of the Finding. The string should describe the impressions the observer had during the observation of an object.

Specified by:
setDescription in interface IFinding
Parameters:
description - A description of the finding.
Throws:
java.lang.IllegalArgumentException - if description was null

getLanguage

public java.lang.String getLanguage()
Returns the language in which this session is described as ISO language string. E.g. de=German, fr=French, ...
Might return null if no language was set for this session.

Specified by:
getLanguage in interface IFinding
Returns:
Returns a ISO language code that represents the sessions describtion language or null if no language was set at all.
Since:
1.5

setLanguage

public void setLanguage(java.lang.String language)
Sets the language in which this finding is described. String must be given as ISO language string. E.g. de=German, fr=French, ...

Specified by:
setLanguage in interface IFinding
Parameters:
language - ISO language string
Since:
1.5

wasSeen

public boolean wasSeen()
Returns true if the target was seen with this finding or not. As findings might be created to document that an object was not seen this flag can be used for checks.

Specified by:
wasSeen in interface IFinding
Returns:
Returns true if the target was seen with this finding
Since:
1.6

setSeen

public void setSeen(boolean seen)
Set to true if the target was seen by the observer.

Specified by:
setSeen in interface IFinding
Parameters:
seen - true if the target was seen by the observer or false if the target was not seen
Since:
1.6

createXmlFindingElement

protected org.w3c.dom.Element createXmlFindingElement(org.w3c.dom.Element parent)
Creates an XML DOM Element for the Finding. The new Finding element will be added as child element to an given parent element. All specialised subclasses may use this method to create a Finding element under which they may store their addition data.
Example:
<parentElement>
<result>
More specialised stuff goes here
</result>
</parentElement>

Parameters:
parent - The parent element for the Finding
Returns:
Returns a Finding element which is a child of the given parent element.
Might return null if parent was null.
See Also:
Element