src/java/fr/jayasoft/ivy/parser/AbstractModuleDescriptorParser.java
/**
         * Evaluate the optional condition in the given configuration, like "[org=MYORG]confX".
         * If the condition evaluates to true, the configuration is returned, if the condition
         * evaluatate to false, null is returned.
         * If there are no conditions, the configuration itself is returned.
         * 
		 * @param conf the configuration to evaluate
		 * @param dd the dependencydescriptor to which the configuration will be added
		 * @return the evaluated condition
		 */
Evaluate the optional condition in the given configuration, like "[org=MYORG]confX".
If the condition evaluates to true, the configuration is returned, if the condition
evaluatate to false, null is returned.
If there are no conditions, the configuration itself is returned.

@param conf the configuration to evaluate
@param dd the dependencydescriptor to which the configuration will be added
@return the evaluated condition
Evaluate the optional condition in the given configuration like " [ org = MYORG ] confX " . If the condition evaluates to true the configuration is returned if the condition evaluatate to false null is returned . If there are no conditions the configuration itself is returned . @param conf the configuration to evaluate @param dd the dependencydescriptor to which the configuration will be added @return the evaluated condition
private String evaluateCondition(String conf, DefaultDependencyDescriptor dd) {
			if (conf.charAt(0) != '[') {
				return conf;
			}
			int endConditionIndex = conf.indexOf(']');
			if (endConditionIndex == -1) {
				addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
                return null;
			}
			String condition = conf.substring(1, endConditionIndex);
			int notEqualIndex = condition.indexOf("!=");
			if (notEqualIndex == -1) {
				int equalIndex = condition.indexOf('=');
				if (equalIndex == -1) { 
					addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
                    return null;
				}
				String leftOp = condition.substring(0, equalIndex).trim();
				String rightOp = condition.substring(equalIndex + 1).trim();
				if (leftOp.equals("org") || leftOp.equals("organization")) {
					leftOp = "organisation";
				}
				String attrValue = dd.getAttribute(leftOp);
				if (!rightOp.equals(attrValue)) {
					return null;
				}
			} else {
				String leftOp = condition.substring(0, notEqualIndex).trim();
				String rightOp = condition.substring(notEqualIndex + 2).trim();
				if (leftOp.equals("org") || leftOp.equals("organization")) {
					leftOp = "organisation";
				}
				String attrValue = dd.getAttribute(leftOp);
				if (rightOp.equals(attrValue)) {
					return null;
				}
			}
			return conf.substring(endConditionIndex + 1);
		}
private String evaluateCondition ( String conf , DefaultDependencyDescriptor dd ) { if ( conf . charAt ( 0 ) != '[' ) { return conf ; } int endConditionIndex = conf . indexOf ( ']' ) ; if ( endConditionIndex == - 1 ) { addError ( "invalid conf " + conf + " for " + dd . getDependencyRevisionId ( ) ) ; return null ; } String condition = conf . substring ( 1 , endConditionIndex ) ; int notEqualIndex = condition . indexOf ( "!=" ) ; if ( notEqualIndex == - 1 ) { int equalIndex = condition . indexOf ( '=' ) ; if ( equalIndex == - 1 ) { addError ( "invalid conf " + conf + " for " + dd . getDependencyRevisionId ( ) ) ; return null ; } String leftOp = condition . substring ( 0 , equalIndex ) . trim ( ) ; String rightOp = condition . substring ( equalIndex + 1 ) . trim ( ) ; if ( leftOp . equals ( "org" ) || leftOp . equals ( "organization" ) ) { leftOp = "organisation" ; } String attrValue = dd . getAttribute ( leftOp ) ; if ( ! rightOp . equals ( attrValue ) ) { return null ; } } else { String leftOp = condition . substring ( 0 , notEqualIndex ) . trim ( ) ; String rightOp = condition . substring ( notEqualIndex + 2 ) . trim ( ) ; if ( leftOp . equals ( "org" ) || leftOp . equals ( "organization" ) ) { leftOp = "organisation" ; } String attrValue = dd . getAttribute ( leftOp ) ; if ( rightOp . equals ( attrValue ) ) { return null ; } } return conf . substring ( endConditionIndex + 1 ) ; }
Evaluate the optional condition in the given configuration, like "[org=MYORG]confX".
Evaluate the optional condition in the given configuration like " [ org = MYORG ] confX " .
// allow organisation synonyms, like 'org' or 'organization'
 // allow organisation synonyms, like 'org' or 'organization'
