ERTaggable< T extends ERXGenericRecord > Class Reference

Collaboration diagram for ERTaggable< T extends ERXGenericRecord >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addTagNamed (String tagName)
void addTags (boolean clear, Object tags)
void addTags (Object tags)
void clearTags ()
boolean equals (Object obj)
int hashCode ()
boolean isTaggedWith (String tagName)
boolean isTaggedWithAll (Object tags)
boolean isTaggedWithAny (Object tags)
item ()
void removeTagNamed (String tagName)
void removeTags (Object tags)
void setTags (Object tags)
ERTaggableEntity< T > taggableEntity ()
NSArray< StringtagNames ()
NSArray< ERTagtags ()

Static Public Member Functions

static
< TextendsERXGenericRecord >
ERTaggable< T > 
taggable (T eo)

Protected Member Functions

void addTag (ERTag tag)
 ERTaggable (ERTaggableEntity< T > entity, T item)
void removeTag (ERTag tag)

Private Attributes

ERTaggableEntity< T > _entity
_item


Detailed Description

ERTaggable provides a wrapper around a taggable EO, extending it with tagging-related methods.

Typically you would provide a cover method from your EO to an instance of an ERTaggable:

 public class Person extends _Person {
   ...
   public ERTaggable<Person> taggable() {
     return ERTaggable.taggable(this);
   }
 }
 

Author:
mschrag
Parameters:
<T> the type of EO that is being wrapped

Constructor & Destructor Documentation

ERTaggable ( ERTaggableEntity< T >  entity,
item 
) [protected]

Constructs an ERTaggable wrapper.

Parameters:
entity the ERTaggableEntity that corresponds to this item's entity
item the item to wrap


Member Function Documentation

void addTag ( ERTag  tag  )  [protected]

Adds the tag to this item. This is the single method that to override if you need to perform some additional operations.

Parameters:
tag the tag to add

void addTagNamed ( String  tagName  ) 

This method applies tags to the target object, by looking up the corresponding Tag object instances and adding it to the tag collection of the object. If the tag name already exists in the tags table, it just adds a relationship to the existing tag record. If it doesn't exist, it then creates a new Tag record for it.

This is equivalent to addTags(false, tags).

Parameters:
tagName the tag name to add

void addTags ( boolean  clear,
Object  tags 
)

This method applies tags to the target object, by parsing the tags parameter into Tag object instances and adding them to the tag collection of the object. If the tag name already exists in the tags table, it just adds a relationship to the existing tag record. If it doesn't exist, it then creates a new Tag record for it.

Parameters:
tags the tags to add (String to tokenize, NSArray<String>, etc)
clear if true, existing tags will be removed first

void addTags ( Object  tags  ) 

This method applies tags to the target object, by parsing the tags parameter into Tag object instances and adding them to the tag collection of the object. If the tag name already exists in the tags table, it just adds a relationship to the existing tag record. If it doesn't exist, it then creates a new Tag record for it.

This is equivalent to addTags(false, tags).

Parameters:
tags the tags to add (String to tokenize, NSArray<String>, etc)

void clearTags (  ) 

Removes all of the tags associated with this item.

boolean equals ( Object  obj  ) 

int hashCode (  ) 

boolean isTaggedWith ( String  tagName  ) 

Checks to see if this object has been tagged with the given tag name.

Parameters:
tagName the tag name to check
Returns:
true if this eo is tagged with the given tag name, false otherwise

boolean isTaggedWithAll ( Object  tags  ) 

Checks to see if this object has been tagged with all the given tags.

Parameters:
tags the tags to add (String to tokenize, NSArray<String>, etc)
Returns:
true if this eo is tagged with all of the given tag names, false otherwise

boolean isTaggedWithAny ( Object  tags  ) 

Checks to see if this object has been tagged with any of the given tags.

Parameters:
tags the tags to add (String to tokenize, NSArray<String>, etc)
Returns:
true if this eo is tagged with any of the given tag names, false otherwise

T item (  ) 

Returns the tagged item that this is taggable is wrapping.

Returns:
the tagged item

void removeTag ( ERTag  tag  )  [protected]

Removes the tag from this item. This is the single method that to override if you need to perform some additional operations.

Parameters:
tag the tag to remove

void removeTagNamed ( String  tagName  ) 

This method removes tags from the target object, by looking up the corresponding Tag object instances and removing them from the tag collection of the object if they exist.

Parameters:
tagName the tag to remove (String to tokenize, NSArray<String>, etc)

void removeTags ( Object  tags  ) 

This method removes tags from the target object, by parsing the tags parameter into Tag object instances and removing them from the tag collection of the object if they exist.

Parameters:
tags the tags to remove (String to tokenize, NSArray<String>, etc)

void setTags ( Object  tags  ) 

Clears the current tags collection and sets the tag names for this object. Equivalent of calling addTags(tags, true).

Parameters:
tags the tags to add (String to tokenize, NSArray<String>, etc)

static <TextendsERXGenericRecord> ERTaggable<T> taggable ( eo  )  [static]

A factory method for generating a taggable from an EO.

Parameters:
<T> the type of the EO being wrapped
eo the EO being wrapped
Returns:
a taggable wrapper around the EO

ERTaggableEntity<T> taggableEntity (  ) 

Returns the taggable entity for this taggable.

Returns:
the taggable entity for this taggable

NSArray<String> tagNames (  ) 

Returns an array of strings containing the tag names applied to this object.

Returns:
an array of strings containing the tag names applied to this object

NSArray<ERTag> tags (  ) 

Returns an array of ERTags associated with this item.

Returns:
an array of ERTags associated with this item


Member Data Documentation

ERTaggableEntity<T> _entity [private]

T _item [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:35 2012 for Project Wonder by  doxygen 1.5.8