com.flexive.shared.value
Class ReferencedContent

java.lang.Object
  extended by com.flexive.shared.content.FxPK
      extended by com.flexive.shared.value.ReferencedContent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FxPK>

public class ReferencedContent
extends FxPK
implements java.io.Serializable

A referenced content - value class for FxReference

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.flexive.shared.content.FxPK
id, LIVE, MAX, NEW_ID, version
 
Constructor Summary
ReferencedContent()
          Ctor
ReferencedContent(FxPK pk)
          Ctor
ReferencedContent(FxPK pk, java.lang.String caption, Step step, java.util.List<ACL> acls)
          Ctor
ReferencedContent(long id)
          Ctor
ReferencedContent(long id, int version)
          Ctor
ReferencedContent(ReferencedContent other)
          Copy constructor.
 
Method Summary
 ReferencedContent copy()
          Returns a copy of this ReferencedContent instance.
 boolean equals(java.lang.Object obj)
           Note: FxPKs with generic version information like FxPK.LIVE or FxPK.MAX will return "false" if they are checked for equality with FxPKs that contain a distinct version information.
static ReferencedContent fromString(java.lang.String value)
          Evaluates the given string value to an object of type ReferencedContent.
 java.util.List<ACL> getAcls()
          Return the ACL(s) assigned to the reference.
 java.lang.String getCaption()
          Get the caption of the referenced content, only available if loaded
 FxContent getContent()
          Get the assigned FxContent for this reference
 Step getStep()
          Get the step for this reference
 boolean hasACL()
          Is an ACL known for this reference?
 boolean hasContent()
          Is a loaded FxContent assigned for this reference?
 int hashCode()
          
 boolean hasStep()
          Is a step known for this reference?
 boolean isAccessGranted()
          Is access to the referenced FxContent granted?
 boolean isResolved()
          Returns true if the content instance has already been resolved.
 void setAccessGranted(boolean accessGranted)
          Set if (read) access to the referenced instance is granted.
 void setContent(FxContent content)
          Set the assigned FxContent for this reference
 java.lang.String toStringExtended()
           
 
Methods inherited from class com.flexive.shared.content.FxPK
compareTo, createNewPK, fromObject, getId, getIds, getPks, getStorageMode, getVersion, isDistinctVersion, isNew, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferencedContent

public ReferencedContent(FxPK pk,
                         java.lang.String caption,
                         Step step,
                         java.util.List<ACL> acls)
Ctor

Parameters:
pk - referenced primary key
caption - caption of the referenced content, only available if loaded
step - the step
acls - the ACL(s)
Since:
3.1

ReferencedContent

public ReferencedContent(FxPK pk)
Ctor

Parameters:
pk - referenced primary key

ReferencedContent

public ReferencedContent(long id,
                         int version)
Ctor

Parameters:
id - id
version - version

ReferencedContent

public ReferencedContent(long id)
Ctor

Parameters:
id - id

ReferencedContent

public ReferencedContent()
Ctor


ReferencedContent

public ReferencedContent(ReferencedContent other)
Copy constructor.

Parameters:
other - the instance to be copied
Method Detail

copy

public ReferencedContent copy()
Returns a copy of this ReferencedContent instance.

Returns:
a copy of this ReferencedContent instance.

getCaption

public java.lang.String getCaption()
Get the caption of the referenced content, only available if loaded

Returns:
caption of the referenced content, only available if loaded

hasStep

public boolean hasStep()
Is a step known for this reference?

Returns:
if a step is known for this reference

hasACL

public boolean hasACL()
Is an ACL known for this reference?

Returns:
if an ACL is known for this reference

getStep

public Step getStep()
Get the step for this reference

Returns:
step of this reference

getAcls

public java.util.List<ACL> getAcls()
Return the ACL(s) assigned to the reference.

Returns:
the ACL(s) assigned to the reference
Since:
3.1

hasContent

public boolean hasContent()
Is a loaded FxContent assigned for this reference?

Returns:
if a loaded FxContent is assigned for this reference

getContent

public FxContent getContent()
Get the assigned FxContent for this reference

Returns:
the assigned FxContent for this reference

isResolved

public boolean isResolved()
Returns true if the content instance has already been resolved.

Returns:
true if the content instance has already been resolved.

setContent

public void setContent(FxContent content)
Set the assigned FxContent for this reference

Parameters:
content - the assigned FxContent for this reference

isAccessGranted

public boolean isAccessGranted()
Is access to the referenced FxContent granted?

Returns:
if access to the referenced FxContent is granted

setAccessGranted

public void setAccessGranted(boolean accessGranted)
Set if (read) access to the referenced instance is granted. This flag is usually set during creation of a ReferencedContent. Setting it to true will not enable you to read the referenced content ;-)

Parameters:
accessGranted - if access to the referenced content is granted

hashCode

public int hashCode()

Overrides:
hashCode in class FxPK

equals

public boolean equals(java.lang.Object obj)
Description copied from class: FxPK
Note: FxPKs with generic version information like FxPK.LIVE or FxPK.MAX will return "false" if they are checked for equality with FxPKs that contain a distinct version information. Consider using FxContent.matchesPk(FxPK) if appropriate.

Overrides:
equals in class FxPK
Parameters:
obj - the other object to compare
Returns:
true if obj is a ReferencedContent and the id and caption are equal

fromString

public static ReferencedContent fromString(java.lang.String value)
Evaluates the given string value to an object of type ReferencedContent.

Parameters:
value - string value to be evaluated
Returns:
the value interpreted as ReferencedContent

toStringExtended

public java.lang.String toStringExtended()