WebSphere Enterprise Service Bus, 버전 6.2.0 운영 체제: AIX, HP-UX, i5/OS, Linux, Solaris, Windows


내 DataObject에 anyAttribute 태그가 있는지 확인하는 방법

인스턴스 특성을 확인하여 열린 특성 중에 속성이 있는지 확인함으로써 DataObject의 인스턴스에 anyAttribute 값이 설정되었는지 여부를 간단히 판별할 수 있습니다.

DataObject는 DataObject 유형에 anyAttribute 태그가 있는지 판별할 수 있는 메커니즘을 제공하지 않습니다. DataObject에는 any 및 <anyAttribute/> 둘 다에 적용되고 모든 특성을 자유롭게 추가할 수 있도록 허용하는 "열림" 개념만 있습니다. DataObject에서 isOpen() = true, isSequenced() = false인 경우는 참이지만 이 경우 anyAttribute 태그가 있어야 하며 isOpen() = true, isSequenced() = true인 경우에는 DataObject 유형에 anyAttribute 태그가 있을 수도 있습니다.

DataObject는 메타데이터 조회 메소드를 제공하여 DataObject를 생성하는 데 사용된 XSD 구조에 대한 해당 질문 및 기타 질문에 프로그래밍을 통해 응답합니다. anyAttribute 태그가 있는지 확인해야 하는 경우 InfoSet 모델을 조회할 수 있습니다. anyAttribute는 단일 속성이며 참 또는 참이 아님 둘 중 하나이므로 비즈니스 오브젝트 또한 BOXSDHelper hasAnyAttribute(Type) 메소드를 제공하여 해당 DataObject에 대해 열린 속성을 설정하면 유효한 결과가 생성되는지 여부를 판별할 수 있도록 합니다. 다음 코드 예제는 이러한 개념에 대해 설명합니다.

	DataObject dobj = ...

	// Check to see if the type is open, if it isn't then it can't have
	// anyAttribute values set in it.
	boolean isOpen = dobj.getType().isOpen();

	if (!isOpen) return false;  // Does not have anyAttribute values set

	// Open Properties are added to the Instance Property list, but not
	// the Property list, so comparing their sizes can easily determine
	// if any open data is set
	int instancePropertyCount = dobj.getInstanceProperties().size();
	int definedPropertyCount = dobj.getType().getProperties().size();

	// If equal, does not have any open content set
	if (instancePropertyCount == definedPropertyCount) return false;

	// Check the open content Properties to determine if any are Attributes
	for (int i=definedPropertyCount; i<instancePropertyCount; i++)
	{
	    Property prop = (Property)dobj.getInstanceProperties().get(i);
	    if (boXsdHelper.isAttribute(prop))
	    {
	        return true;  // Found an anyAttribute value
	    }
	}

	return false;  // Does not have anyAttribute values set

concept 개념 주제

이용약관 | 피드백


시간소인 아이콘 마지막 갱신 날짜: 2010년 7월 7일 수요일


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.doc/doc/cbo_howdataobjany.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
이 Information Center는 Eclipse 기술을 기반으로 합니다(http://www.eclipse.org 웹 사이트 참조).