public XSComponent attributeUse(XSAttributeUse use) { return use.getDecl(); // inherit from the declaration }
/** * Determine whether the definition contains "list" attribute (directly or indirectly) */ private boolean isList(XSComplexType complexType) { Collection<? extends XSAttributeUse> attributeUses = complexType.getAttributeUses(); return attributeUses != null && attributeUses.stream() .anyMatch(au -> au.getDecl() != null && DOMUtil.IS_LIST_ATTRIBUTE_NAME.equals(au.getDecl().getName())); }
public T attributeUse(XSAttributeUse attributeUse) { return attributeUse.getDecl().apply(this); }
public void attributeUse(XSAttributeUse use) { use.getDecl().visit(this); }
@Override public QName attributeUse(final XSAttributeUse use) { return attributeDecl(use.getDecl()); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
@Override public Boolean attributeUse(final XSAttributeUse use) { return use.getFixedValue() != null || use.getDecl().getFixedValue() != null; }
public void attributeUse(XSAttributeUse use) { if(check(use)) use.getDecl().visit(this); }
public void attributeUse(XSAttributeUse use) { if(check(use)) use.getDecl().visit(this); }
public void attributeUse(XSAttributeUse use) { if(check(use)) use.getDecl().visit(this); }
public void attributeUse(XSAttributeUse use) { if(check(use)) use.getDecl().visit(this); }
public void attributeUse(XSAttributeUse use) { if(check(use)) use.getDecl().visit(this); }
@Override public String attributeUse(final XSAttributeUse use) { String customName = getCustomPropertyName(use); customName = customName == null ? getCustomPropertyName(use.getDecl()) : customName; return customName == null ? GroupInterfaceGenerator.this.pluginContext.outline.getModel().getNameConverter().toPropertyName(use.getDecl().getName()) : customName; }
protected void loadAttributes(Schema schema, XSComplexType xsct, ComplexType ct) throws TypeBindingException { Collection<? extends XSAttributeUse> attrs = xsct.getAttributeUses(); for (XSAttributeUse attr : attrs) { XSAttributeDecl at = attr.getDecl(); Type fieldType = loadType(schema, at.getType(), at.getName()); if (fieldType == null) { throw new TypeBindingException("Cannot add type for '" + at.getName() + "'"); } createField(ct, at, fieldType, !attr.isRequired()); } }
private String getConstantName(final FieldOutline fieldOutline) { final XSComponent schemaComponent = fieldOutline.getPropertyInfo().getSchemaComponent(); if (!this.fixedAttributeAsConstantProperty) return null; if (schemaComponent instanceof XSAttributeDecl) { return ((XSAttributeDecl)schemaComponent).getFixedValue() != null ? fieldOutline.parent().parent().getModel().getNameConverter().toConstantName(((XSAttributeDecl)schemaComponent).getName()) : null; } else { return schemaComponent instanceof XSAttributeUse && ((XSAttributeUse)schemaComponent).getFixedValue() != null ? fieldOutline.parent().parent().getModel().getNameConverter().toConstantName(((XSAttributeUse)schemaComponent).getDecl().getName()) : null; } }