public static boolean hasAnnotation(XSComponent xsComponent, QName qname) { if (xsComponent == null) { return false; } return hasAnnotation(xsComponent.getAnnotation(false), qname) != null; }
/** * 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 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; } };
public static boolean hasAnnotation(ClassOutline classOutline, QName qname) { XSComponent xsComponent = classOutline.target.getSchemaComponent(); if (xsComponent == null) { return false; } return hasAnnotation(xsComponent.getAnnotation(false), qname) != 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; }
/** * 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; }
XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) {
XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) {
XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==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; }
XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) {
XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) {