SmartFrog 3.10.000

org.smartfrog.sfcore.reference
Class HereReferencePart

java.lang.Object
  extended by org.smartfrog.sfcore.reference.ReferencePart
      extended by org.smartfrog.sfcore.reference.HereReferencePart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Copying
Direct Known Subclasses:
AttribReferencePart

public class HereReferencePart
extends ReferencePart

Implements the most basic of reference parts. This reference part knows how to resolve itself to the value of a given id in a given reference resolver.

See Also:
Serialized Form

Field Summary
static java.lang.String HERE
          Base string representation of this part (HERE).
 
Constructor Summary
HereReferencePart(java.lang.Object v)
          Constructs HereReferencePart with a here part.
 
Method Summary
 ReferencePart asAttribReferencePart()
          Converts this reference part to an AttribReferencePart.
 boolean equals(java.lang.Object refPart)
          Compares this reference part with another one.
 java.lang.Object getValue()
           
 int hashCode()
          Returns hashcode of this part.
 java.lang.Object resolve(ReferenceResolver rr, Reference r, int index)
          Resolves this reference part using the reference resolver.
 java.lang.Object resolve(RemoteReferenceResolver rr, Reference r, int index)
          Resolves this reference part using the remote reference resolver.
 java.lang.Object setValue(java.lang.Object value)
          Sets new value and returs old value.
 LogSF sfGetProcessLog()
          To get the sfCore logger
 java.lang.String toString()
          Returns a string representation of the reference part.
 java.lang.String toString(int index)
          Return a string which is a representation of the reference part in a reference in the index position given.
 
Methods inherited from class org.smartfrog.sfcore.reference.ReferencePart
attrib, clone, copy, forwardReference, here, host, iproperty, parent, process, property, root, thisref
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HERE

public static final java.lang.String HERE
Base string representation of this part (HERE).

See Also:
Constant Field Values
Constructor Detail

HereReferencePart

public HereReferencePart(java.lang.Object v)
Constructs HereReferencePart with a here part.

Parameters:
v - value for here part
Method Detail

getValue

public java.lang.Object getValue()

setValue

public java.lang.Object setValue(java.lang.Object value)
Sets new value and returs old value.

Parameters:
value - Object
Returns:
Object

asAttribReferencePart

public ReferencePart asAttribReferencePart()
Converts this reference part to an AttribReferencePart. This is used by type references, which get their first part converted to an attrib reference part in order to do relatvice type lookups

Returns:
attrib reference part

toString

public java.lang.String toString()
Returns a string representation of the reference part. Implements abstract method ReferencePart.toString.

Specified by:
toString in class ReferencePart
Returns:
stringified reference part

toString

public java.lang.String toString(int index)
Return a string which is a representation of the reference part in a reference in the index position given.

Overrides:
toString in class ReferencePart
Parameters:
index - the position in the reference
Returns:
the representation

hashCode

public int hashCode()
Returns hashcode of this part. This is the hashCode of the stored value

Specified by:
hashCode in class ReferencePart
Returns:
hash code for part

equals

public boolean equals(java.lang.Object refPart)
Compares this reference part with another one. Equality means that the type and value are equal

Specified by:
equals in class ReferencePart
Parameters:
refPart - to be compared to
Returns:
true if equal, false if not

resolve

public java.lang.Object resolve(ReferenceResolver rr,
                                Reference r,
                                int index)
                         throws SmartFrogResolutionException
Resolves this reference part using the reference resolver. The originating reference and index are needed to enable request forwarding

Specified by:
resolve in class ReferencePart
Parameters:
rr - reference resolver
r - reference which this part sits in
index - index of this reference part in r
Returns:
the attribute found on resolution
Throws:
SmartFrogResolutionException - if failed to resolve reference

resolve

public java.lang.Object resolve(RemoteReferenceResolver rr,
                                Reference r,
                                int index)
                         throws SmartFrogResolutionException
Resolves this reference part using the remote reference resolver. The originating reference and index are needed to enable request forwarding

Specified by:
resolve in class ReferencePart
Parameters:
rr - reference resolver
r - reference which this part sits in
index - index of this reference part in r
Returns:
the attribute found on resolution
Throws:
SmartFrogResolutionException - if failed to resolve reference

sfGetProcessLog

public LogSF sfGetProcessLog()
To get the sfCore logger

Returns:
Logger implementing LogSF and Log

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP