예제 #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);
 }
예제 #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);
  }
예제 #3
0
 public XSComponent attributeUse(XSAttributeUse use) {
   return use.getDecl(); // inherit from the declaration
 }
예제 #4
0
 public Boolean attributeUse(XSAttributeUse use) {
   return use.getFixedValue() != null;
 }