public XmlString getDefaultValue() { if( defaultValue!=null ) return defaultValue; else return getDecl().getDefaultValue(); }
/** * Processes an xsd attribute. * <p> * Example: * <xsd:complexType name="Employee"> * <xsd:simpleContent> * <xsd:extension base="a:Person"> * <xsd:attribute name="id" type="xsd:string" use="optional"/> << "id" is the attributePropertyName * </xsd:extension> * </xsd:simpleContent> * </xsd:complexType> */ private void processAttribute(CAttributePropertyInfo attributeProperty, ClassOutline classOutline, List<FacetCustomization> customizations) { String attributePropertyName = attributeProperty.getName(false); JFieldVar fieldVar = classOutline.implClass.fields().get(attributePropertyName); AttributeUseImpl attribute = (AttributeUseImpl) attributeProperty.getSchemaComponent(); XSSimpleType type = attribute.getDecl().getType(); // Use="required". It makes sense to annotate a required attribute with @NotNull even though it's not 100 % semantically equivalent. if (attribute.isRequired() && !fieldVar.type().isPrimitive()) notNullAnnotate(fieldVar); processSimpleType(type, fieldVar, customizations); }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
/** * Processes an xsd attribute. * <p> * Example: * <xsd:complexType name="Employee"> * <xsd:simpleContent> * <xsd:extension base="a:Person"> * <xsd:attribute name="id" type="xsd:string" use="optional"/> << "id" is the attributePropertyName * </xsd:extension> * </xsd:simpleContent> * </xsd:complexType> */ private void processAttribute(CAttributePropertyInfo attributeProperty, ClassOutline classOutline, List<FacetCustomization> customizations) { String attributePropertyName = attributeProperty.getName(false); JFieldVar fieldVar = classOutline.implClass.fields().get(attributePropertyName); AttributeUseImpl attribute = (AttributeUseImpl) attributeProperty.getSchemaComponent(); XSSimpleType type = attribute.getDecl().getType(); // Use="required". It makes sense to annotate a required attribute with @NotNull even though it's not 100 % semantically equivalent. if (attribute.isRequired() && !fieldVar.type().isPrimitive()) { notNullAnnotate(fieldVar); } processSimpleType(null, type, fieldVar, customizations); }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
public XmlString getFixedValue() { if( fixedValue!=null ) return fixedValue; else return getDecl().getFixedValue(); }
/** * XS:Attribute */ public void processAttribute(CAttributePropertyInfo property, ClassOutline clase, Outline model) { FieldOutline field = model.getField(property); String propertyName = property.getName(false); String className = clase.implClass.name(); log("Attribute " + propertyName + " added to class " + className); XSComponent definition = property.getSchemaComponent(); AttributeUseImpl particle = (AttributeUseImpl) definition; XSSimpleType type = particle.getDecl().getType(); JFieldVar var = clase.implClass.fields().get(propertyName); if (particle.isRequired()) { if (!hasAnnotation(var, NotNull.class)) { processNotNull(clase, var); } } validAnnotation(type, var, propertyName, className); processType(type, var, propertyName, className); }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
public XmlString getDefaultValue() { if( defaultValue!=null ) return defaultValue; else return getDecl().getDefaultValue(); }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
public XmlString getFixedValue() { if( fixedValue!=null ) return fixedValue; else return getDecl().getFixedValue(); }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
public XmlString getDefaultValue() { if( defaultValue!=null ) return defaultValue; else return getDecl().getDefaultValue(); }
public XmlString getFixedValue() { if( fixedValue!=null ) return fixedValue; else return getDecl().getFixedValue(); }
public XmlString getFixedValue() { if( fixedValue!=null ) return fixedValue; else return getDecl().getFixedValue(); }
public XmlString getDefaultValue() { if( defaultValue!=null ) return defaultValue; else return getDecl().getDefaultValue(); }
public XmlString getDefaultValue() { if( defaultValue!=null ) return defaultValue; else return getDecl().getDefaultValue(); }
public XmlString getFixedValue() { if( fixedValue!=null ) return fixedValue; else return getDecl().getFixedValue(); }