private void addTextAnnotation(XSType xsType, OntClass ontClass) { if (xsType.getAnnotation() != null && xsType.getAnnotation().getAnnotation() != null) { String textAnnotation = xsType.getAnnotation().getAnnotation().toString(); ontClass.addProperty(RDFS.comment, textAnnotation); } }
private boolean isObjectReference(XSElementDecl xsElementDecl, XSType xsType) { XSAnnotation annotation = xsType.getAnnotation(); return isObjectReference(xsType, annotation); }
@NotNull private List<String> getIgnoredNamespaces(XSType xsType) { List<String> rv = new ArrayList<>(); List<Element> annoElements = SchemaProcessorUtil.getAnnotationElements(xsType.getAnnotation(), A_IGNORED_NAMESPACE); for (Element annoElement : annoElements) { rv.add(annoElement.getTextContent()); } if (xsType.getBaseType() != null && !xsType.getBaseType().equals(xsType)) { rv.addAll(getIgnoredNamespaces(xsType.getBaseType())); } return rv; }
private String getDefaultNamespace(XSType xsType) { Element annoElement = SchemaProcessorUtil.getAnnotationElement(xsType.getAnnotation(), A_DEFAULT_NAMESPACE); if (annoElement != null) { return annoElement.getTextContent(); } if (xsType.getBaseType() != null && !xsType.getBaseType().equals(xsType)) { return getDefaultNamespace(xsType.getBaseType()); } return null; }
/** * Returns true if provides XSD type is a property container. It looks for * annotations. */ private boolean isPropertyContainer(XSType xsType) { Element annoElement = SchemaProcessorUtil.getAnnotationElement(xsType.getAnnotation(), A_PROPERTY_CONTAINER); if (annoElement != null) { return true; } if (xsType.getBaseType() != null && !xsType.getBaseType().equals(xsType)) { return isPropertyContainer(xsType.getBaseType()); } return false; }
public static boolean hasAnnotation(XSType xsType, QName annotationElementName) { if (xsType.getName() == null) { return false; } Element annotationElement = getAnnotationElement(xsType.getAnnotation(), annotationElementName); if (annotationElement != null) { return true; } if (xsType.getBaseType() != null && !xsType.getBaseType().equals(xsType)) { return hasAnnotation(xsType.getBaseType(), annotationElementName); } return false; }
XSAnnotation containerAnnotation = xsType.getAnnotation(); PrismContainerDefinition<?> containerDefinition = createPropertyContainerDefinition( xsType, p, null, containerAnnotation, false);