/** * Get the static cardinality of the expression */ public int computeCardinality() { int c = StaticProperty.ALLOWS_ONE; if (allowEmpty && Cardinality.allowsZero(getBaseExpression().getCardinality())) { c |= StaticProperty.ALLOWS_ZERO; } try { if (targetType.containsListType()) { c |= StaticProperty.ALLOWS_ZERO; c |= StaticProperty.ALLOWS_MANY; } } catch (MissingComponentException e) { c |= StaticProperty.ALLOWS_ZERO; c |= StaticProperty.ALLOWS_MANY; } return c; }