private void postcheckMappingConditions ( MtasParserObject object , List < Map < String , String > > mappingConditions , Map < String , List < MtasParserObject > > currentList ) throws MtasParserException { precheckMappingConditions ( object , mappingConditions , currentList ) ; for ( Map < String , String > mappingCondition : mappingConditions ) { // condition on text if ( mappingCondition . get ( "type" ) . equals ( MtasParserMapping . PARSER_TYPE_TEXT ) ) { MtasParserObject [ ] checkObjects = computeObjectFromMappingValue ( object , mappingCondition , currentList ) ; if ( checkObjects != null ) { String textCondition = mappingCondition . get ( MAPPING_VALUE_CONDITION ) ; String textValue = object . getText ( ) ; Boolean notCondition = false ; if ( mappingCondition . get ( "not" ) != null ) { notCondition = true ; } if ( ( textCondition == null ) && ( ( textValue == null ) || textValue . isEmpty ( ) ) ) { if ( ! notCondition ) { throw new MtasParserException ( "no text available" ) ; } } else if ( ( textCondition != null ) && ( textValue == null ) ) { if ( ! notCondition ) { throw new MtasParserException ( "condition " + textCondition + " on text not matched (is null)" ) ; } } else if ( textCondition != null ) { if ( ! notCondition && ! textCondition . equals ( textValue ) ) { throw new MtasParserException ( "condition " + textCondition + " on text not matched (is " + textValue + ")" ) ; } else if ( notCondition && textCondition . equals ( textValue ) ) { throw new MtasParserException ( "condition NOT " + textCondition + " on text not matched (is " + textValue + ")" ) ; } } } } } }
Postcheck mapping conditions .