public List < String > findOnlyExistingMatchingObjectNames ( String objectExpression ) { String [ ] parts = objectExpression . split ( "," ) ; List < String > allSortedObjectNames = getSortedObjectNames ( ) ; List < String > resultingObjectNames = new LinkedList <> ( ) ; for ( String part : parts ) { String singleExpression = part . trim ( ) ; if ( ! singleExpression . isEmpty ( ) ) { if ( GalenUtils . isObjectGroup ( singleExpression ) ) { resultingObjectNames . addAll ( findObjectsInGroup ( GalenUtils . extractGroupName ( singleExpression ) ) ) ; } else if ( GalenUtils . isObjectsSearchExpression ( singleExpression ) ) { Pattern objectPattern = GalenUtils . convertObjectNameRegex ( singleExpression ) ; for ( String objectName : allSortedObjectNames ) { if ( objectPattern . matcher ( objectName ) . matches ( ) ) { resultingObjectNames . add ( objectName ) ; } } } else if ( objects . containsKey ( singleExpression ) ) { resultingObjectNames . add ( singleExpression ) ; } } } return resultingObjectNames ; }
Find all objects that match galen object statements