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


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

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

DataObject는 DataObject 유형에 any 태그가 있는지 판별할 수 있는 메커니즘을 제공하지 않습니다. DataObject에는 any 및 anyAttribute 둘 다에 적용되고 모든 특성을 자유롭게 추가할 수 있도록 허용하는 "열림" 개념만 있습니다. any 태그가 있는 경우 DataObject에서 isOpen() = true, isSequenced() = true가 되지만, anyAttribute 태그 및 순서 주제에서 설명한 순서 지정 이유 중 하나가 있을 수도 있습니다. 다음 예제는 이러한 개념에 대해 설명합니다.

	DataObject dobj = ...

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

	if (!isOpen) return false;  // Does not have any 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 Elements
	for (int i=definedPropertyCount; i < instancePropertyCount; i++)
	{
	    Property prop = (Property)dobj.getInstanceProperties().get(i);
	    if (boXsdHelper.isElement(prop))
	    {
	        return true;  // Found an any value
	    }
	}

	return false;  // Does not have any values set

concept 개념 주제

이용약관 | 피드백


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


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