org.w3c.css.sac.CombinatorCondition Java Examples

The following examples show how to use org.w3c.css.sac.CombinatorCondition. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CSSConditionalSelector.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void countConditions
  ( final int[] conditionCounter, final Condition condition ) {
  if ( condition.getConditionType() == Condition.SAC_ID_CONDITION ) {
    conditionCounter[ ID_CONDITION ] += 1;
  } else if ( condition instanceof AttributeCondition ) {
    conditionCounter[ ATTR_CONDITION ] += 1;
  } else if ( condition instanceof CombinatorCondition ) {
    CombinatorCondition c = (CombinatorCondition) condition;
    countConditions( conditionCounter, c.getFirstCondition() );
    countConditions( conditionCounter, c.getSecondCondition() );
  } else {
    conditionCounter[ OTHER_CONDITION ] += 1;
  }
}
 
Example #2
Source File: CSSConditionalSelector.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void countConditions( final int[] conditionCounter, final Condition condition ) {
  if ( condition.getConditionType() == Condition.SAC_ID_CONDITION ) {
    conditionCounter[ID_CONDITION] += 1;
  } else if ( condition instanceof AttributeCondition ) {
    conditionCounter[ATTR_CONDITION] += 1;
  } else if ( condition instanceof CombinatorCondition ) {
    final CombinatorCondition c = (CombinatorCondition) condition;
    countConditions( conditionCounter, c.getFirstCondition() );
    countConditions( conditionCounter, c.getSecondCondition() );
  } else {
    conditionCounter[OTHER_CONDITION] += 1;
  }
}
 
Example #3
Source File: CSSConditionFactory.java    From tm4e with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public CombinatorCondition createAndCondition(Condition first,
		Condition second) throws CSSException {
	return new CSSAndCondition(first, second);
}
 
Example #4
Source File: CSSConditionFactory.java    From tm4e with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public CombinatorCondition createOrCondition(Condition arg0, Condition arg1) throws CSSException {
	throw new CSSException("Not implemented in CSS2");
}
 
Example #5
Source File: FixNamespaceConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public CombinatorCondition createAndCondition( final Condition first,
                                               final Condition second )
  throws CSSException {
  return parent.createAndCondition( first, second );
}
 
Example #6
Source File: FixNamespaceConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public CombinatorCondition createOrCondition( final Condition first,
                                              final Condition second )
  throws CSSException {
  return parent.createOrCondition( first, second );
}
 
Example #7
Source File: FixNamespaceConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public CombinatorCondition createAndCondition( final Condition first, final Condition second ) throws CSSException {
  return parent.createAndCondition( first, second );
}
 
Example #8
Source File: FixNamespaceConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public CombinatorCondition createOrCondition( final Condition first, final Condition second ) throws CSSException {
  return parent.createOrCondition( first, second );
}
 
Example #9
Source File: ConditionFactoryImpl.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an and condition
 *
 * @param first  the first condition
 * @param second the second condition
 * @return A combinator condition
 * @throws CSSException if this exception is not supported.
 */
public CombinatorCondition createAndCondition( Condition first,
                                               Condition second )
  throws CSSException {
  return new AndConditionImpl( first, second );
}
 
Example #10
Source File: ConditionFactoryImpl.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an or condition
 *
 * @param first  the first condition
 * @param second the second condition
 * @return A combinator condition
 * @throws CSSException if this exception is not supported.
 */
public CombinatorCondition createOrCondition( Condition first,
                                              Condition second )
  throws CSSException {
  throw new CSSException( CSSException.SAC_NOT_SUPPORTED_ERR );
}
 
Example #11
Source File: CSSConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an and condition
 *
 * @param first  the first condition
 * @param second the second condition
 * @return A combinator condition
 * @throws CSSException if this exception is not supported.
 */
public CombinatorCondition createAndCondition( Condition first,
                                               Condition second )
  throws CSSException {
  return new AndCSSCondition( (CSSCondition) first, (CSSCondition) second );
}
 
Example #12
Source File: CSSConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an or condition
 *
 * @param first  the first condition
 * @param second the second condition
 * @return A combinator condition
 * @throws CSSException if this exception is not supported.
 */
public CombinatorCondition createOrCondition( Condition first,
                                              Condition second )
  throws CSSException {
  return new OrCSSCondition( (CSSCondition) first, (CSSCondition) second );
}
 
Example #13
Source File: CSSConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an and condition
 *
 * @param first
 *          the first condition
 * @param second
 *          the second condition
 * @return A combinator condition
 * @throws CSSException
 *           if this exception is not supported.
 */
public CombinatorCondition createAndCondition( final Condition first, final Condition second ) throws CSSException {
  return new AndCSSCondition( (CSSCondition) first, (CSSCondition) second );
}
 
Example #14
Source File: CSSConditionFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates an or condition
 *
 * @param first
 *          the first condition
 * @param second
 *          the second condition
 * @return A combinator condition
 * @throws CSSException
 *           if this exception is not supported.
 */
public CombinatorCondition createOrCondition( final Condition first, final Condition second ) throws CSSException {
  return new OrCSSCondition( (CSSCondition) first, (CSSCondition) second );
}