| Method from org.apache.xmlbeans.impl.schema.SchemaAnnotationImpl Detail: |
public static SchemaAnnotationImpl getAnnotation(SchemaContainer c,
Annotated elem) {
AnnotationDocument.Annotation ann = elem.getAnnotation();
return getAnnotation(c, elem, ann);
}
|
public static SchemaAnnotationImpl getAnnotation(SchemaContainer c,
XmlObject elem,
Annotation ann) {
// Check option
if (StscState.get().noAnn())
return null;
SchemaAnnotationImpl result = new SchemaAnnotationImpl(c);
// Retrieving attributes, first attributes on the enclosing element
ArrayList attrArray = new ArrayList(2);
addNoSchemaAttributes(elem, attrArray);
if (ann == null)
{
if (attrArray.size() == 0)
return null; // no annotation present
// no annotation element present, but attributes on the enclosing
// element present, so we have an annotation component
result._appInfo = new AppinfoDocument.Appinfo[0];
result._documentation = new DocumentationDocument.Documentation[0];
}
else
{
result._appInfo = ann.getAppinfoArray();
result._documentation = ann.getDocumentationArray();
// Now the attributes on the annotation element
addNoSchemaAttributes(ann, attrArray);
}
result._attributes =
(AttributeImpl[]) attrArray.toArray(new AttributeImpl[attrArray.size()]);
return result;
}
|
public XmlObject[] getApplicationInformation() {
if (_appInfo == null)
{
int n = _appInfoAsXml.length;
_appInfo = new AppinfoDocument.Appinfo[n];
for (int i = 0; i < n; i++)
{
String appInfo = _appInfoAsXml[i];
try
{
_appInfo[i] = AppinfoDocument.Factory.
parse(appInfo).getAppinfo();
}
catch(XmlException e)
{
// problem in the classfile
_appInfo[i] = AppinfoDocument.Factory.
newInstance().getAppinfo();
}
}
}
return _appInfo;
}
|
public Attribute[] getAttributes() {
return _attributes;
}
|
public SchemaComponent.Ref getComponentRef() {
return null;
}
|
public int getComponentType() {
return ANNOTATION;
}
|
SchemaContainer getContainer() {
return _container;
}
|
public QName getName() {
return null;
}
|
public String getSourceName() {
return _filename;
}
|
public SchemaTypeSystem getTypeSystem() {
return _container != null ? _container.getTypeSystem() : null;
}
|
public XmlObject[] getUserInformation() {
if (_documentation == null)
{
int n = _documentationAsXml.length;
_documentation = new DocumentationDocument.Documentation[n];
for (int i = 0; i < n; i++)
{
String doc = _documentationAsXml[i];
try
{
_documentation[i] = DocumentationDocument.Factory.
parse(doc).getDocumentation();
}
catch (XmlException e)
{
// problem in the classfile
_documentation[i] = DocumentationDocument.Factory.
newInstance().getDocumentation();
}
}
}
return _documentation;
}
|
public void setFilename(String filename) {
_filename = filename;
}
|