Beispiel #1
0
 private CCustomizations getCustomizations(XSAttributeUse src) {
   // customizations for an attribute use should include those defined in the local attribute.
   // this is so that the schema like:
   //
   // <xs:attribute name="foo" type="xs:int">
   //   <xs:annotation><xs:appinfo>
   //     <hyperjaxb:... />
   //
   // would be picked up
   if (src.getDecl().isLocal()) return getCustomizations(src, src.getDecl());
   else return getCustomizations((XSComponent) src);
 }
Beispiel #2
0
  public CAttributePropertyInfo createAttributeProperty(XSAttributeUse use, TypeUse tu) {

    boolean forConstant = getCustomization(use).isConstantProperty() && use.getFixedValue() != null;

    String name = getPropertyName(forConstant);
    if (name == null) {
      NameConverter conv = getBuilder().getNameConverter();
      if (forConstant) name = conv.toConstantName(use.getDecl().getName());
      else name = conv.toPropertyName(use.getDecl().getName());
      if (tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode())
        name = JJavaName.getPluralForm(name);
    }

    markAsAcknowledged();
    constantPropertyErrorCheck();

    return wrapUp(
        new CAttributePropertyInfo(
            name,
            use,
            getCustomizations(use),
            use.getLocator(),
            BGMBuilder.getName(use.getDecl()),
            tu,
            BGMBuilder.getName(use.getDecl().getType()),
            use.isRequired()),
        use);
  }
Beispiel #3
0
 public XSComponent attributeUse(XSAttributeUse use) {
   return use.getDecl(); // inherit from the declaration
 }
Beispiel #4
0
 public Boolean attributeUse(XSAttributeUse use) {
   return use.getFixedValue() != null;
 }