{
/* IntOrTokenAnyAttrImpl is the class registered for this extension attribute. Use this type
* here, rather than the IntOrTokenAttr interface, to guarantee that if the code contains an
* xs:token it is of type #any.
*/
IntOrTokenAnyAttrImpl code = (IntOrTokenAnyAttrImpl) ((WSDLElement) getParent())
.getExtensionAttribute(HTTPConstants.Q_ATTR_CODE);
if(code == null)
{
//defaults to xs:token #any if the attribute is omitted from the WSDL.
return HTTPErrorStatusCode.ANY;
}
else if(code.isToken())
{
//if IntOrTokenAnyAttrImpl contains a token then is must be '#any'
return HTTPErrorStatusCode.ANY;
}
else if(code.isInt())
{
return new HTTPErrorStatusCode(code.getInt());
}
else
{
//the whttp:code attribute contains an invalid value (i.e. not an xs:QName or the xs:token #any)
//TODO confirm if this should be represented in the Component model as a null