private void parseAnnotations(NeutralSchema neutralSchema, XmlSchemaType schemaType) { if (neutralSchema == null || schemaType == null || schemaType.getAnnotation() == null) { return; } parseDocumentation(neutralSchema, schemaType); parseAppInfo(neutralSchema, schemaType); }
private void parseDocumentation(NeutralSchema neutralSchema, XmlSchemaType schemaType) { XmlSchemaObjectCollection annotations = schemaType.getAnnotation().getItems(); for (int annotationIdx = 0; annotationIdx < annotations.getCount(); ++annotationIdx) { XmlSchemaObject annotation = annotations.getItem(annotationIdx); if (annotation instanceof XmlSchemaDocumentation) { XmlSchemaDocumentation docs = (XmlSchemaDocumentation) annotation; neutralSchema.addAnnotation(new Documentation(docs.getMarkup())); } } }
private void parseAppInfo(NeutralSchema neutralSchema, XmlSchemaType schemaType) { XmlSchemaObjectCollection annotations = schemaType.getAnnotation().getItems(); for (int annotationIdx = 0; annotationIdx < annotations.getCount(); ++annotationIdx) { XmlSchemaObject annotation = annotations.getItem(annotationIdx); if (annotation instanceof XmlSchemaAppInfo) { XmlSchemaAppInfo info = (XmlSchemaAppInfo) annotation; neutralSchema.addAnnotation(new AppInfo(info.getMarkup())); } } }