BeanContextSupport

BeanContextSupport (BeanContext 지원 클래스)

java.beans.beancontext.BeanContext 인터페이스의 유틸리티 구현을 제공하는 헬퍼 클래스예요. 이 클래스는 BeanContext 인터페이스를 직접 구현하므로, 이 구현을 상속하거나 다른 클래스에서 이 클래스의 인스턴스를 위임 방식으로 사용할 수 있어요.

출처: Java API Reference

본문

BeanContextSupportBeanContextChildSupport를 상속하면서 BeanContext, Serializable, PropertyChangeListener, VetoableChangeListener를 구현하는 클래스예요. BeanContext의 기본 동작 — 자식 빈의 추가·제거·조회와 같은 계층 관리 기능 — 을 구현해요.

이 클래스는 BeanContext 안에 중첩된 자식 객체들을 관리하고, 디자인 타임 여부, GUI 사용 가능 여부, 로케일 같은 환경 정보를 보관해요. add()/remove() 같은 메서드로 자식 빈을 추가하거나 제거하고, 자식 빈들의 변경을 리스너에게 알려요.

주요 필드와 생성자는 다음과 같아요.

protected transient HashMap<Object, BeanContextSupport.BCSChild> children
protected transient ArrayList<BeanContextMembershipListener> bcmListeners
protected Locale locale
protected boolean okToUseGui
protected boolean designTime

public BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
public BeanContextSupport(BeanContext peer, Locale lcle)
public BeanContextSupport(BeanContext peer)
  • children — BeanContext에 포함된 자식 객체들의 맵이에요.
  • designTime — 디자인 타임(개발 시각) 여부예요.
  • okToUseGui — GUI를 사용해도 되는지 여부예요.

BeanContextServicesSupport가 이 클래스의 직접적인 하위 클래스로 알려져 있어요. 이 클래스는 Serializable이라 직렬화가 가능해요.

더 알아보기 (Learn more)

Java 공식 API