se.kmr.scam.editor.util
Interface ValueObject

All Known Implementing Classes:
PredicateValueObject, ValueObjectImpl

public interface ValueObject

Should be renamed to Value. Wrapper for a fact in a value model.

Version:
$Revision: 1.19 $
Author:
Matthias
Created:
den 29 november 2002

Method Summary
 ValueObject duplicate()
          Creates an (structural)duplicate of this object, all values are set to default.
 String getLanguage()
          Gets the literalLanguage attribute of the ValueObject object
 RDFNode getNode()
          Gets the node attribute of the ValueObject object
 Property getPredicate()
           
 Resource getResource()
          Gets the resource attribute of the ValueObject object
 Resource getSubject()
          Gets the subject attribute of the ValueObject object
 String getValue()
          Gets the language attribute of the value, if such exists.
 boolean isDummy()
          Tells wether a valueobject is empty, i.e. set to a dummy value.
 boolean isEdited()
           
 int isOk()
          OBS OBS OBS, THIS FUNCTION IS UNUSED AND I CAN'T FIGURE IT'S FUNCTION.
 boolean isValid()
           
 void remove()
          Removes the fact from the RDF-model
 void removeValueAndPossibleConstraints()
          Removes the fact from the RDF-model by calling the remove() and then all other constraints from the value-node in the case it is a resource.
 void setEdited(boolean edited)
           
 void setPredicate(Property newPredicate)
           
 void setValid(boolean valid)
          Used for validation of values in forms.
 void setValue(String value)
          Sets the literal value of the fact.
 void setValue(String value, String language)
          Sets the value of the fact.
 

Method Detail

getNode

public RDFNode getNode()
Gets the node attribute of the ValueObject object

Returns:
The node value

getSubject

public Resource getSubject()
Gets the subject attribute of the ValueObject object

Returns:
The subject value

getResource

public Resource getResource()
Gets the resource attribute of the ValueObject object

Returns:
The node value, as a resource.

getValue

public String getValue()
Gets the language attribute of the value, if such exists.

Returns:
The string value of the language. The string is empty if no language exists.

getLanguage

public String getLanguage()
Gets the literalLanguage attribute of the ValueObject object

Returns:
The literalLanguage value

setValue

public void setValue(String value)
              throws RDFException
Sets the literal value of the fact.

Parameters:
value - The new value
Throws:
RDFException - thrown in case of exception while updating the object.

setValue

public void setValue(String value,
                     String language)
              throws RDFException
Sets the value of the fact. If the fact is represented by a Literal the value will be set with a language attribute. (The language attribute will only set if the language argument is non-null)
For facts that is represented by Resource will the language argument have no effect.

Parameters:
value - The new value
language - The new language value
Throws:
RDFException - thrown if the value is null, the object represents a root node or in case of exception while updating the data model.

setPredicate

public void setPredicate(Property newPredicate)
                  throws RDFException
Throws:
RDFException

getPredicate

public Property getPredicate()
                      throws RDFException
Throws:
RDFException

duplicate

public ValueObject duplicate()
                      throws RDFException
Creates an (structural)duplicate of this object, all values are set to default. Typically is this method used for duplicating ValueObject that wrapps facts in form of Statements

NOTE: The data model is updated with the new object

Returns:
If this object represents a Statement a (structural)duplicate of this object, otherwise null.
Throws:
RDFException - thrown in case of exception while duplicating the Statement

remove

public void remove()
            throws RDFException
Removes the fact from the RDF-model

Throws:
RDFException - thrown in case of exception while removing fact from the RDF-model.

removeValueAndPossibleConstraints

public void removeValueAndPossibleConstraints()
                                       throws RDFException
Removes the fact from the RDF-model by calling the remove() and then all other constraints from the value-node in the case it is a resource.

Throws:
RDFException - thrown in case of exception while removing fact from the RDF-model.

isEdited

public boolean isEdited()
Returns:

isValid

public boolean isValid()
Returns:

isOk

public int isOk()
OBS OBS OBS, THIS FUNCTION IS UNUSED AND I CAN'T FIGURE IT'S FUNCTION. Enlighten me by explaining it here.... Otherwise I will remove it. /Matthias

Returns:

setValid

public void setValid(boolean valid)
Used for validation of values in forms.


isDummy

public boolean isDummy()
Tells wether a valueobject is empty, i.e. set to a dummy value.

Returns:
boolean

setEdited

public void setEdited(boolean edited)
Throws:
RDFException


Copyright © 2003 SCAM. All Rights Reserved.