private boolean isAccountObject(XSAnnotation annotation) { if (annotation == null || annotation.getAnnotation() == null) { return false; } Element accountType = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_ACCOUNT); if (accountType != null) { return true; } return false; }
BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) { bi = new BindInfo(); ann.setAnnotation(bi);
BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) { bi = new BindInfo(); ann.setAnnotation(bi);
@NotNull public static List<Element> getAnnotationElements(XSAnnotation annotation, QName qname) { List<Element> elements = new ArrayList<>(); if (annotation == null) { return elements; } Element xsdAnnotation = (Element) annotation.getAnnotation(); NodeList list = xsdAnnotation.getElementsByTagNameNS(qname.getNamespaceURI(), qname.getLocalPart()); if (list != null && list.getLength() > 0) { for (int i = 0; i < list.getLength(); i++) { elements.add((Element) list.item(i)); } } return elements; }
BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) { bi = new BindInfo(); ann.setAnnotation(bi);
private XSAnnotation selectAnnotationToUse(XSAnnotation particleAnnotation, XSAnnotation termAnnotation) { boolean useParticleAnnotation = false; if (particleAnnotation != null && particleAnnotation.getAnnotation() != null) { if (testAnnotationAppinfo(particleAnnotation)) { useParticleAnnotation = true; } } boolean useTermAnnotation = false; if (termAnnotation != null && termAnnotation.getAnnotation() != null) { if (testAnnotationAppinfo(termAnnotation)) { useTermAnnotation = true; } } if (useParticleAnnotation) { return particleAnnotation; } if (useTermAnnotation) { return termAnnotation; } return null; }
BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) { bi = new BindInfo(); ann.setAnnotation(bi);
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); } }
BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) { bi = new BindInfo(); ann.setAnnotation(bi);
/** * Assigns documentation, corresponding to the annotation provided, * to the target model element. * @param modelElement is non-null UML model element * @param component is the XML schema component this model element represents */ private void assignDocumentation(ModelElement modelElement, XSComponent component) { String comments; if ( component != null && component.getAnnotation() != null && component.getAnnotation().getAnnotation() instanceof String) { comments = ((String) component.getAnnotation().getAnnotation()).trim(); factory.constructTagDocumentation(modelElement, comments ); } }
private static BIDeclaration hasAnnotation(XSAnnotation annotation, QName qname) { if (annotation == null) { return null; } Object object = annotation.getAnnotation(); if (!(object instanceof BindInfo)) { return null; } BindInfo info = (BindInfo) object; BIDeclaration[] declarations = info.getDecls(); if (declarations == null) { return null; } for (BIDeclaration declaration : declarations) { if (qname.equals(declaration.getName())) { return declaration; } } return null; }
private String getCustomPropertyName(final XSComponent component) { if (component.getAnnotation() != null && (component.getAnnotation().getAnnotation() instanceof BindInfo)) { final BindInfo bindInfo = (BindInfo) component.getAnnotation().getAnnotation(); final BIProperty biProperty = bindInfo.get(BIProperty.class); if (biProperty != null) { final String customPropertyName = biProperty.getPropertyName(false); return customPropertyName != null ? customPropertyName : null; } } return null; } };
/** * Check that given field property has name customization ({@code <jaxb:property name="..." />}). * * @see <code>com.sun.xml.bind.api.impl.NameUtil</code> * @see com.sun.codemodel.JJavaName * @see com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty#getCustomization(XSComponent) */ public static boolean hasPropertyNameCustomization(CPropertyInfo fieldPropertyInfo) { XSAnnotation annotation = fieldPropertyInfo.getSchemaComponent().getAnnotation(); if (annotation == null) { annotation = getXsdDeclaration(fieldPropertyInfo).getAnnotation(); } if (annotation == null || !(annotation.getAnnotation() instanceof BindInfo)) { return false; } for (BIDeclaration declaration : (BindInfo) annotation.getAnnotation()) { if (declaration instanceof BIProperty) { return true; } } return false; }
/** * Check that given field property has name customization ({@code <jaxb:property name="..." />}). * * @see <code>com.sun.xml.bind.api.impl.NameUtil</code> * @see com.sun.codemodel.JJavaName * @see com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty#getCustomization(XSComponent) */ public static boolean hasPropertyNameCustomization(CPropertyInfo fieldPropertyInfo) { XSAnnotation annotation = fieldPropertyInfo.getSchemaComponent().getAnnotation(); if (annotation == null) { annotation = getXsdDeclaration(fieldPropertyInfo).getAnnotation(); } if (annotation == null || !(annotation.getAnnotation() instanceof BindInfo)) { return false; } for (BIDeclaration declaration : (BindInfo) annotation.getAnnotation()) { if (declaration instanceof BIProperty) { return true; } } return false; }
/** * Gets the BindInfo object associated to a schema component. * * @return * null if no bind info is associated to this schema component. */ private BindInfo _getBindInfoReadOnly( XSComponent schemaComponent ) { BindInfo bi = externalBindInfos.get(schemaComponent); if(bi!=null) return bi; XSAnnotation annon = schemaComponent.getAnnotation(); if(annon!=null) { bi = (BindInfo)annon.getAnnotation(); if(bi!=null) { if(bi.getOwner()==null) bi.setOwner(this,schemaComponent); return bi; } } return null; }
/** * Gets the BindInfo object associated to a schema component. * * @return * null if no bind info is associated to this schema component. */ private BindInfo _getBindInfoReadOnly( XSComponent schemaComponent ) { BindInfo bi = externalBindInfos.get(schemaComponent); if(bi!=null) return bi; XSAnnotation annon = schemaComponent.getAnnotation(); if(annon!=null) { bi = (BindInfo)annon.getAnnotation(); if(bi!=null) { if(bi.getOwner()==null) bi.setOwner(this,schemaComponent); return bi; } } return null; }
/** * Gets the BindInfo object associated to a schema component. * * @return * null if no bind info is associated to this schema component. */ private BindInfo _getBindInfoReadOnly( XSComponent schemaComponent ) { BindInfo bi = externalBindInfos.get(schemaComponent); if(bi!=null) return bi; XSAnnotation annon = schemaComponent.getAnnotation(); if(annon!=null) { bi = (BindInfo)annon.getAnnotation(); if(bi!=null) { if(bi.getOwner()==null) bi.setOwner(this,schemaComponent); return bi; } } return null; }
/** * Gets the BindInfo object associated to a schema component. * * @return * null if no bind info is associated to this schema component. */ private BindInfo _getBindInfoReadOnly( XSComponent schemaComponent ) { BindInfo bi = externalBindInfos.get(schemaComponent); if(bi!=null) return bi; XSAnnotation annon = schemaComponent.getAnnotation(); if(annon!=null) { bi = (BindInfo)annon.getAnnotation(); if(bi!=null) { if(bi.getOwner()==null) bi.setOwner(this,schemaComponent); return bi; } } return null; }
/** * Gets the BindInfo object associated to a schema component. * * @return * null if no bind info is associated to this schema component. */ private BindInfo _getBindInfoReadOnly( XSComponent schemaComponent ) { BindInfo bi = externalBindInfos.get(schemaComponent); if(bi!=null) return bi; XSAnnotation annon = schemaComponent.getAnnotation(); if(annon!=null) { bi = (BindInfo)annon.getAnnotation(); if(bi!=null) { if(bi.getOwner()==null) bi.setOwner(this,schemaComponent); return bi; } } return null; }
private void parseItemDefinitionAnnotations(MutableItemDefinition itemDef, XSAnnotation annotation) throws SchemaException { if (annotation == null || annotation.getAnnotation() == null) { return;