public void setFinal(final DerivationMethod derivation, final boolean enabled) { assertNotLocked(); PreCondition.assertArgumentNotNull(derivation, "derivation"); PreCondition.assertTrue( derivation.isExtension() || derivation.isRestriction(), "derivation (" + derivation + ") must be extension or restriction for a complex type"); if (enabled) { m_final.add(derivation); } else { m_final.remove(derivation); } }
private static SchemaWildcard computeAttributeWildcard( final Type baseType, final DerivationMethod derivation) { if (derivation.isRestriction()) { return null; } if (derivation.isExtension()) { if (baseType instanceof ComplexType) { return ((ComplexType) baseType).getAttributeWildcard(); } else { return null; } } else { throw new AssertionError(derivation); } }