protected DefaultAttributeType(AttributeType copy) { this.name = copy.getName(); this.type = copy.getType(); this.nillable = copy.isNillable(); this.min = copy.getMinOccurs(); this.max = copy.getMaxOccurs(); this.defaultValue = copy.createDefaultValue(); }
protected DefaultAttributeType(AttributeType copy) { super(copy.getType(),copy.getName(),copy.getMinOccurs(),copy.getMaxOccurs(),copy.isNillable(),copy.getDefaultValue()); }
private AttributeType override(AttributeType type, AttributeType override ){ int max = override.getMaxOccurs(); if( max < 0 ) max = type.getMinOccurs(); int min = override.getMinOccurs(); if( min < 0 ) min = type.getMinOccurs(); String name = override.getName(); if( name == null ) name = type.getName(); Filter restriction = override( type.getRestriction(), override.getRestriction() ); Class javaType = override.getType(); if( javaType == null ) javaType = type.getType(); boolean isNilable = override.isNillable(); Object defaultValue = override.createDefaultValue(); if( defaultValue == null ) defaultValue = type.createDefaultValue(); // WARNING cannot copy metadata! return AttributeTypeFactory.newAttributeType( name, javaType, isNilable, restriction, defaultValue, null ); }