com.apelon.dts.client.events
Class TermEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.apelon.dts.client.events.DataChangeEvent
          extended by com.apelon.dts.client.events.TermEvent
All Implemented Interfaces:
Serializable

public class TermEvent
extends DataChangeEvent

An event which indicates that a term action occurred.

A term action is considered to occur in either of the following situation:

Since:
DTS 3.4
Version:
DTS 3.4
Author:
Apelon Inc.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.apelon.dts.client.events.DataChangeEvent
EVENT_TYPE_DELETE, EVENT_TYPE_FIRST, EVENT_TYPE_LAST, EVENT_TYPE_MODIFY, EVENT_TYPE_NEW, INVALID_TYPE_EVENT
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TermEvent(Object source, Term term, int eventType, TermAttributeChange attributeChange)
          Constructs a TermEvent object.
 
Method Summary
 TermAttributeChange getAttributeChange()
          Get the Term Attribute Change when a term is modified.
 Term getTerm()
          Get the term which has changed.
 boolean isTermAffected(Term term)
          A method to check if a term is affected by this term action.
 
Methods inherited from class com.apelon.dts.client.events.DataChangeEvent
getChangedData, getEventType, getNewData, getOldData
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TermEvent

public TermEvent(Object source,
                 Term term,
                 int eventType,
                 TermAttributeChange attributeChange)
Constructs a TermEvent object. Initializes the term attribute change.

Parameters:
source - Should be an object that is a valid source of Term events.
term - The term which has changed. In the case of modifiy, this should be the term after change.
eventType - If adding a new term, the eventType should be DataChangeEvent.EVENT_TYPE_NEW If modifying a term, the eventType should be DataChangeEvent.EVENT_TYPE_MODIFY If deleting a term, the eventType should be DataChangeEvent.EVENT_TYPE_DELETE
attributeChange - If the term is modified, attributeChange contains the attributes changes information; If the term is added or is deleted, attributeChange should be null.
See Also:
TermListener, DTSEventMulticaster, TermAttributeChange, DataChangeEvent
Method Detail

getAttributeChange

public TermAttributeChange getAttributeChange()
Get the Term Attribute Change when a term is modified.

Returns:
TermAttributeChange It contains the term attribute changes information when a term is updated.

getTerm

public Term getTerm()
Get the term which has changed. This Term may only contains basic term information like name, id, and namespaceid. To get more term information you have to set corresponding TermAttributeSetDescriptor and send a query request to server to get them.

Returns:
Term If a term is added, return the term which is added; If a term is updated, return the term after updating; If a term is deleted, return the term which is deleted.

isTermAffected

public boolean isTermAffected(Term term)
A method to check if a term is affected by this term action.

Parameters:
term - the term to be checked.
Returns:
boolean true - if the term is affected by this term action. false - if the term is not affected by this term action.


Copyright © 2011. All Rights Reserved.