WebSphere Enterprise Service Bus for z/OS, Version 6.2.0 Operating Systems: z/OS


How do I know if my DataObject has an any tag?

You can easily determine if instances of a DataObject have any values set within them by checking the instance properties to see if any of the open properties are attributes.

DataObject does not provide a mechanism for determining if a DataObject Type has an any tag. DataObjects only have the concept of "open" that applies to both any and anyAttribute and allows the free additional of any properties. While the presence of an any tag causes a DataObject to have isOpen() = true and isSequenced() = true, it might just have an anyAttribute tag and one of the reasons for being sequenced discussed in the Sequences topics. The following example demonstrates these concepts:

	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 Concept topic

Terms of use | Feedback


Timestamp icon Last updated: 21 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.zseries.doc/doc/cbo_howdataobjtag.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).