Class MITListItem

All Implemented Interfaces:
Cacheable, LocalizableOM, Serializable, Comparable<MITListItem>, ColumnAccessByName, ObjectModel, Persistent

public class MITListItem extends BaseMITListItem implements LocalizableOM, Comparable<MITListItem>, Cacheable

A module and an iteme type. Wildcards are possible, so that a single MITListItem could represent all the item types in a module. A single item type in all modules (that have it defined). Or all modules and item types.

Parent 를 같고 있으면 Parent 는 하나만 설정하여야 한다.

all --> id = 0, 0 ( see MULTIPLE_MODULE_KEY, MULTIPLE_ITEM_TYPE_KEY )

current --> id = null; 모든 모듈, 모든 아이템유형 : M : 0 & T : 0 현재 모듈, 모든 아이템 유형 : M : NULL & T : 0 현재 모듈의 형식은 아주 특별한 경우에만 사용하여야 한다.

모든 모듈, 아이템 유형 : M : 0 , T : 0

현재 모듈, 아이템 유형 : M : NULL & T : T

특정 모듈 모든 아이템 유형 : M : M & T : 0

특정 모듈 아래에 모든 모듈, 모든 아이템 유형 : M : 0 & T : 0 & P : P

특정 모듈 아래에 모든 모듈, 아이템 유형 : M : 0 & T : T & P : P

Version:
$Id: MITListItem.java,v 1.71 2008/12/25 04:03:45 youngho Exp $
Author:
Youngho Cho
  • Constructor Details

    • MITListItem

      public MITListItem()
  • Method Details

    • save

      public void save() throws Exception
      Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed.
      Specified by:
      save in interface Persistent
      Overrides:
      save in class BaseMITListItem
      Throws:
      Exception
    • setModule

      public void setModule(Module module) throws TorqueException
      DOCUMENT ME!
      Parameters:
      module - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getModule

      public Module getModule() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • setParent

      public void setParent(Module module) throws TorqueException
      DOCUMENT ME!
      Parameters:
      module - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getParent

      public Module getParent() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • hasParent

      public boolean hasParent()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • compareTo

      public int compareTo(MITListItem obj)
      Comparable 처리 보다 큰 범위이면 1, 동일한 범위이면 0, 보다 작은 범위이면 -1 먼저 itemType 을 비교한다. 그 다음 Module 범위를 구한다. Substract 는 비교하지 않는다. 범위를 비교할 수 없으면 UnsupportedOperationException 을 던진다.
      Specified by:
      compareTo in interface Comparable<MITListItem>
    • isSingleModuleItemType

      public boolean isSingleModuleItemType()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • isSingleModule

      public boolean isSingleModule()
      대상이 SingleModule 인지
    • isSingleItemType

      public boolean isSingleItemType()
      대상이 SingleItemType 인지
    • isUseCurrentModule

      public boolean isUseCurrentModule()
      where use CurrentModule
    • isUseCurrentItemType

      public boolean isUseCurrentItemType()
      where use CurrentItemType
    • isForAllModule

      public boolean isForAllModule()
      모든 Module 에 적용하는지 즉 ModuleId 가 ItemTypeEnum.ALL.getId()
    • getModuleItemType

      public ModuleItemType getModuleItemType() throws TorqueException
      isSingleModuleItemType 일 경우 ModuleItemType 을 구한다. 그외는 null 을
      Returns:
      moduleItemType or null
      Throws:
      TorqueException
    • getModuleAttribute

      public ModuleAttribute getModuleAttribute(Attribute attribute) throws TorqueException
      isSingleModuleItemType 일 경우 ModuleAttribute 을 구한다.
      Parameters:
      attribute -
      Returns:
      ma or null
      Throws:
      TorqueException
    • hashCode

      public int hashCode()
      Description copied from class: BaseMITListItem
      If the primary key is not null, return the hashcode of the primary key. Otherwise calls Object.hashCode().
      Overrides:
      hashCode in class BaseMITListItem
      Returns:
      an int value
    • equals

      public boolean equals(Object obj)
      동일대상을 처리하면 equals 처리한다.
      Overrides:
      equals in class BaseMITListItem
      Parameters:
      obj -
      Returns:
      Whether the primary keys are equal and the object have the same class.
    • getModuleIds

      protected List<Long> getModuleIds() throws TorqueException
      Returns:
      moduleIds collection for all 이면 null 을 return 한다.
      Throws:
      TorqueException
    • getItemTypeIds

      protected List<Integer> getItemTypeIds() throws TorqueException
      Returns:
      ItemTypeIds collection
      Throws:
      TorqueException
    • getAttributeIds

      protected List<Integer> getAttributeIds() throws TorqueException
      주의 : CurrentModule, CurrentItemType 은 지원하지 않는다.
      Throws:
      TorqueException
    • getAttributeIds

      protected List<Integer> getAttributeIds(boolean activeOnly, boolean commonOnly) throws TorqueException
      Parameters:
      activeOnly -
      commonOnly -
      Returns:
      attribute list
      Throws:
      TorqueException
    • toKeyString

      public String toKeyString()
      P\dI\d+, M\d+I\d+ 의 Pattern 으로 문자열을 만든다. null 이면 Pnull, Mnull 등과 같이 표현한다. 검색범위 문자열 TODO : expression language
    • getBitMatrix

      public BitMatrix getBitMatrix(Module module, ItemType type) throws TorqueException
      human readerble expression

      모든 모듈, 아이템 유형 : P M 0 T 0 P

      현재 모듈, 아이템 유형 : P M T : T P

      특정 모듈 모든 아이템 유형 : P M M T 0 P

      특정 모듈 아래에 모든 모듈, 모든 아이템 유형 : P P M 0 T 0

      특정 모듈 아래에 모든 모듈, 아이템 유형 : P P M 0 T T

      Parameters:
      module - currentModule
      type - currentItemType
      Returns:
      bitMatrix
      Throws:
      TorqueException
    • toExpression

      public String toExpression()
      human readerble expression

      모든 모듈, 아이템 유형 : P M 0 T 0 P

      현재 모듈, 아이템 유형 : P M T : T P

      특정 모듈 모든 아이템 유형 : P M M T 0 P

      특정 모듈 아래에 모든 모듈, 모든 아이템 유형 : P P M 0 T 0

      특정 모듈 아래에 모든 모듈, 아이템 유형 : P P M 0 T T

      Returns:
      string representation
    • toString

      public String toString()
      toString()
      Overrides:
      toString in class BaseMITListItem
      Returns:
      string representation
    • getLocalized

      public Localized[] getLocalized(Locale locale) throws TorqueException
      Description copied from interface: LocalizableOM
      locale 에 해당하는 localized 정보를 구한다.
      Specified by:
      getLocalized in interface LocalizableOM
      Parameters:
      locale -
      Returns:
      localized
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getMethodCache

      public MethodResultCache getMethodCache()
      Specified by:
      getMethodCache in interface Cacheable
      Returns:
      MethodResultCache
    • clear

      public void clear()
      Description copied from interface: Cacheable
      clear this Serializable instance cache
      Specified by:
      clear in interface Cacheable