private void processRestriction(String targetNamespace, String defaultNamespace, SDOType owningType, Restriction restriction) { if (restriction != null) { String qualifiedType = restriction.getBaseType(); Type baseType = processBaseType(targetNamespace, defaultNamespace, owningType, qualifiedType, false, restriction); boolean alreadyIn = inRestriction; if (!alreadyIn) { inRestriction = true; } if (restriction.getChoice() != null) { processChoice(targetNamespace, defaultNamespace, owningType, restriction.getChoice(), false); } else if (restriction.getSequence() != null) { processSequence(targetNamespace, defaultNamespace, owningType, restriction.getSequence(), false); } else if (restriction.getAll() != null) { processAll(targetNamespace, defaultNamespace, owningType, restriction.getAll(), false); } processAttributes(targetNamespace, defaultNamespace, owningType, restriction.getAttributes()); if (!alreadyIn) { inRestriction = false; } owningType.setOpen(owningType.isOpen() || baseType.isOpen()); } }
private void processRestriction(String targetNamespace, String defaultNamespace, SDOType owningType, Restriction restriction) { if (restriction != null) { String qualifiedType = restriction.getBaseType(); Type baseType = processBaseType(targetNamespace, defaultNamespace, owningType, qualifiedType, false, restriction); boolean alreadyIn = inRestriction; if (!alreadyIn) { inRestriction = true; } if (restriction.getChoice() != null) { processChoice(targetNamespace, defaultNamespace, owningType, restriction.getChoice(), false); } else if (restriction.getSequence() != null) { processSequence(targetNamespace, defaultNamespace, owningType, restriction.getSequence(), false); } else if (restriction.getAll() != null) { processAll(targetNamespace, defaultNamespace, owningType, restriction.getAll(), false); } processAttributes(targetNamespace, defaultNamespace, owningType, restriction.getAttributes()); if (!alreadyIn) { inRestriction = false; } owningType.setOpen(owningType.isOpen() || baseType.isOpen()); } }
/** * Overwrites attributes of this restriction with attributes of the argument, * if they are not null. * * @param restriction */ public void mergeWith(Restriction restriction) { if (restriction.getAll() != null) this.setAll(restriction.getAll()); if (restriction.getAnyAttribute() != null) this.setAnyAttribute(restriction.getAnyAttribute()); // if (restriction.getBaseType()) // this one doesn't make sense to do // if (restriction.getSimpleType()) // this one doesn't make sense to do if (restriction.getTypeDefParticle() != null) this.setTypeDefParticle(restriction.getTypeDefParticle()); // not sure if this one makes sense if (restriction.getSequence() != null) this.setSequence(restriction.getSequence()); if (restriction.getChoice() != null) this.setChoice(restriction.getChoice()); if (restriction.getEnumerationFacets() != null) this.setEnumerationFacets(restriction.getEnumerationFacets()); if (restriction.getPatterns() != null) this.setPatterns(restriction.getPatterns()); // restriction.getPatterns() is "always" not null if (restriction.getMaxInclusive() != null) this.setMaxInclusive(restriction.getMaxInclusive()); if (restriction.getMinInclusive() != null) this.setMinInclusive(restriction.getMinInclusive()); if (restriction.getMaxExclusive() != null) this.setMaxExclusive(restriction.getMaxExclusive()); if (restriction.getMinExclusive() != null) this.setMinExclusive(restriction.getMinExclusive()); if (restriction.getTotalDigits() != null) this.setFractionDigits(restriction.getTotalDigits()); if (restriction.getFractionDigits() != null) this.setFractionDigits(restriction.getFractionDigits()); if (restriction.getLength() != null) this.setLength(restriction.getLength()); if (restriction.getMinLength() != null) this.setMinLength(restriction.getMinLength()); if (restriction.getMaxLength() != null) this.setMaxLength(restriction.getMaxLength()); } }
/** * Overwrites attributes of this restriction with attributes of the argument, * if they are not null. * * @param restriction */ public void mergeWith(Restriction restriction) { if (restriction.getAll() != null) this.setAll(restriction.getAll()); if (restriction.getAnyAttribute() != null) this.setAnyAttribute(restriction.getAnyAttribute()); // if (restriction.getBaseType()) // this one doesn't make sense to do // if (restriction.getSimpleType()) // this one doesn't make sense to do if (restriction.getTypeDefParticle() != null) this.setTypeDefParticle(restriction.getTypeDefParticle()); // not sure if this one makes sense if (restriction.getSequence() != null) this.setSequence(restriction.getSequence()); if (restriction.getChoice() != null) this.setChoice(restriction.getChoice()); if (restriction.getEnumerationFacets() != null) this.setEnumerationFacets(restriction.getEnumerationFacets()); if (restriction.getPatterns() != null) this.setPatterns(restriction.getPatterns()); if (restriction.getPattern() != null) this.setPattern(restriction.getPattern()); if (restriction.getMaxInclusive() != null) this.setMaxInclusive(restriction.getMaxInclusive()); if (restriction.getMinInclusive() != null) this.setMinInclusive(restriction.getMinInclusive()); if (restriction.getMaxExclusive() != null) this.setMaxExclusive(restriction.getMaxExclusive()); if (restriction.getMinExclusive() != null) this.setMinExclusive(restriction.getMinExclusive()); if (restriction.getTotalDigits() != null) this.setFractionDigits(restriction.getTotalDigits()); if (restriction.getFractionDigits() != null) this.setFractionDigits(restriction.getFractionDigits()); if (restriction.getLength() != null) this.setLength(restriction.getLength()); if (restriction.getMinLength() != null) this.setMinLength(restriction.getMinLength()); if (restriction.getMaxLength() != null) this.setMaxLength(restriction.getMaxLength()); } }