attributeForm = jbossXmlSchema.attributeFormDefault();
elementForm = jbossXmlSchema.elementFormDefault();
}
// Look for an annotation
PackageInfo packageInfo = root.getPackage();
if (packageInfo != null)
{
jbossXmlSchema = root.getUnderlyingAnnotation(JBossXmlSchema.class);
if (jbossXmlSchema != null)
{
if (attributeForm == XmlNsForm.UNSET)
attributeForm = jbossXmlSchema.attributeFormDefault();
if (elementForm == XmlNsForm.UNSET)
elementForm = jbossXmlSchema.elementFormDefault();
}
XmlSchema xmlSchema = packageInfo.getUnderlyingAnnotation(XmlSchema.class);
if (xmlSchema != null)
{
String namespace = xmlSchema.namespace();
if (JBossXmlConstants.DEFAULT.equals(xmlSchema) == false && XMLConstants.NULL_NS_URI.equals(defaultNamespace))
{
defaultNamespace = namespace;
addNamespace(defaultNamespace, true);
}
if (attributeForm == XmlNsForm.UNSET)
attributeForm = xmlSchema.attributeFormDefault();
if (elementForm == XmlNsForm.UNSET)
elementForm = xmlSchema.elementFormDefault();
}
// Check for adapted types
JBossXmlAdaptedTypes adaptedTypes = packageInfo.getUnderlyingAnnotation(JBossXmlAdaptedTypes.class);
if (adaptedTypes != null)
{
for (JBossXmlAdaptedType adaptedType : adaptedTypes.value())
generateAdaptedType(adaptedType);
}
JBossXmlAdaptedType adaptedType = packageInfo.getUnderlyingAnnotation(JBossXmlAdaptedType.class);
if (adaptedType != null)
generateAdaptedType(adaptedType);
}
}