private static ContentMatcher createMatcher ( SimpleTest test , ContentMatcher oldMatcher ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( cclass , "createMatcher" , "test: " + test + ", oldmatcher: " + oldMatcher ) ; Identifier id = test . getIdentifier ( ) ; boolean isExtended = ( test instanceof ExtendedSimpleTestImpl ) ; ContentMatcher ans ; switch ( id . getType ( ) ) { case Selector . BOOLEAN : if ( ! isExtended ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New BooleanMatcher for id " + id . getName ( ) ) ; ans = new BooleanMatcher ( id ) ; } else { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New SetValBooleanMatcher for id " + id . getName ( ) ) ; ans = new SetValBooleanMatcher ( id ) ; } break ; case Selector . UNKNOWN : case Selector . OBJECT : if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New EqualityMatcher for id " + id . getName ( ) ) ; ans = new EqualityMatcher ( id ) ; break ; case Selector . STRING : case Selector . TOPIC : if ( ! isExtended ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New StringMatcher for id " + id . getName ( ) ) ; ans = new StringMatcher ( id ) ; } else { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New SetValStringMatcher for id " + id . getName ( ) ) ; ans = new SetValStringMatcher ( id ) ; } break ; case Selector . CHILD : if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New ExtensionMatcher for id " + id . getName ( ) ) ; ans = new SetValChildAccessMatcher ( id ) ; break ; default : if ( ! isExtended ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New NumericMatcher for id " + id . getName ( ) ) ; ans = new NumericMatcher ( id ) ; } else { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New SetValNumericMatcher for id " + id . getName ( ) ) ; ans = new SetValNumericMatcher ( id ) ; } } ans . vacantChild = oldMatcher ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createMatcher" ) ; return ans ; }
Subroutine to determine the kind of Matcher to create and create it .