com.apelon.dts.client.events
Class TermAttributeChange

java.lang.Object
  extended by com.apelon.dts.client.events.TermAttributeChange

public class TermAttributeChange
extends Object

Defines term attribute change. It contains all information of a term modifying.

The term modifying includes the following situation:

There are three constructors to handle the above situation.

Since:
DTS 3.4
Version:
DTS 3.4
Author:
Apelon Inc.

Field Summary
static int ASSOCIATION
          The constant for term association change
static int DELETE
          The constant for change type DELETE
static int INVALID_TYPE
          The constant for INVALID_TYPE
static int MODIFY
          The constant for change type MODIFY
static int NAME
          The constant for term name change
static int NEW
          The constant for change type NEW
static int PROPERTY
          The constant for term property change
 
Constructor Summary
TermAttributeChange(DTSProperty oldProp, DTSProperty newProp)
          Constructs a TermAttributeChange object for term property change.
TermAttributeChange(String oldName, String newName)
          Constructs a TermAttributeChange object for term name change.
TermAttributeChange(TermAssociation oldAssoc, TermAssociation newAssoc)
          Constructs a TermAttributeChange object for term association change.
 
Method Summary
 int getAttributeType()
          Get Attribute Type.
 int getChangeType()
          Get Change Type.
 Object getNewAttribute()
          Get the new Term Attribute Object.
 Object getOldAttribute()
          Get the old Term Attribute Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final int NAME
The constant for term name change

See Also:
Constant Field Values

ASSOCIATION

public static final int ASSOCIATION
The constant for term association change

See Also:
Constant Field Values

PROPERTY

public static final int PROPERTY
The constant for term property change

See Also:
Constant Field Values

NEW

public static final int NEW
The constant for change type NEW

See Also:
Constant Field Values

MODIFY

public static final int MODIFY
The constant for change type MODIFY

See Also:
Constant Field Values

DELETE

public static final int DELETE
The constant for change type DELETE

See Also:
Constant Field Values

INVALID_TYPE

public static final int INVALID_TYPE
The constant for INVALID_TYPE

See Also:
Constant Field Values
Constructor Detail

TermAttributeChange

public TermAttributeChange(String oldName,
                           String newName)
Constructs a TermAttributeChange object for term name change. Initializes the change type. Initializes the attribute type to NAME.

Parameters:
oldName - If adding a new term name, the oldName should null; If modifying a term name, the oldName should be the name before being updated; If deleting a term name, the oldName should be the name that is deleted.
newName - If adding a new term name, the newName should be the name that is added; If modifying a term name, the newName should be the name after being updated; If deleting a term name, the newName should be null.

TermAttributeChange

public TermAttributeChange(TermAssociation oldAssoc,
                           TermAssociation newAssoc)
Constructs a TermAttributeChange object for term association change. Initializes the change type. Initializes the attribute type to ASSOCIATION.

Parameters:
oldAssoc - If adding a new term association, the oldAssoc should null; If modifying a term association, the oldAssoc should be the association before being updated; If deleting a term association, the oldAssoc should be the association that is deleted.
newAssoc - If adding a new term association, the newAssoc should be the association that is added; If modifying a term association, the newAssoc should be the association after being updated; If deleting a term association, the newAssoc should be null.

TermAttributeChange

public TermAttributeChange(DTSProperty oldProp,
                           DTSProperty newProp)
Constructs a TermAttributeChange object for term property change. Initializes the change type. Initializes the attribute type to PROPERTY.

Parameters:
oldProp - If adding a new term property, the oldProp should null; If modifying a term property, the oldProp should be the property before being updated; If deleting a term property, the oldProp should be the property that is deleted.
newProp - If adding a new term property, the newProp should be the property that is added; If modifying a term property, the newProp should be the property after being updated; If deleting a term property, the newProp should be null.
Method Detail

getChangeType

public int getChangeType()
Get Change Type. The Change Type can be NEW, MODIFY, or DELETE.

Returns:
int If the attribute is added, return NEW; If the attribute is updated, return MODIFY; If the attribute is deleted, return DELETE.

getAttributeType

public int getAttributeType()
Get Attribute Type. The Attribute Type can be NAME, ASSOCIATION, PROPERTY.

Returns:
int If term name is changed, return NAME; If term association is changed, return ASSOCIATION; If term property is changed, return PROPERTY.

getOldAttribute

public Object getOldAttribute()
Get the old Term Attribute Object. According to the getAttributeType() the Term Attribute object can be casted to NAME, TermAssociation, or DTSProperty.

Returns:
Object the term attribute before updating

getNewAttribute

public Object getNewAttribute()
Get the new Term Attribute Object. According to the getAttributeType() the Term Attribute object can be casted to NAME, TermAssociation, or DTSProperty.

Returns:
Object the term attribute after updating


Copyright © 2011. All Rights Reserved.