if (elements != null)
{
for (int j = 0; j < elements.size(); j++)
{
ElementInfo eleinfo = null;
CElementDecl elem =
(CElementDecl) elements.get(j);
if (elem.getAnyElement())
{
Type anyType =
new Type(
CUtils.anyTypeQname,
CUtils.anyTypeQname.getLocalPart(),
true,
targetLanguage);
eleinfo =
new ElementInfo(
elem.getName(),
anyType);
}
else
{
QName typeName = elem.getType().getQName();
if (typeName.getLocalPart().indexOf('[')
> 0)
{
String localpart =
typeName.getLocalPart().substring(
0,
typeName
.getLocalPart()
.indexOf(
'['));
typeName =
new QName(
typeName.getNamespaceURI(),
localpart);
if (CUtils.isBasicType(typeName))
{
eleinfo =
new ElementInfo(
elem.getName(),
createTypeInfo(
typeName,
targetLanguage));
}
else
{
eleinfo =
new ElementInfo(
elem.getName(),
createTypeInfo(
elem.getType(),
targetLanguage));
}
}
else
{
eleinfo =
new ElementInfo(
elem.getName(),
createTypeInfo(
typeName,
targetLanguage));
}
}
eleinfo.setMinOccurs(elem.getMinOccurs());
eleinfo.setMaxOccurs(elem.getMaxOccurs());
eleinfo.setNillable( elem.isNillable());
// Dushshantha:
// states whether this element is a xsd:choice
eleinfo.setChoiceElement(elem.getChoiceElement());
//.................................................
// Chinthana:
// states whether this element is a xsd:all
eleinfo.setAllElement(elem.getAllElement());
//04/05/2005.................................................
//Dushshantha:
//states whether the element must be namespace qualified.
eleinfo.setNsQualified(elem.getNsQualified());
typedata.setTypeNameForElementName(eleinfo);
}
}