private MtasParserObject [ ] computeObjectFromMappingValue ( MtasParserObject object , Map < String , String > mappingValue , Map < String , List < MtasParserObject > > currentList ) throws MtasParserException { MtasParserObject [ ] checkObjects = null ; MtasParserObject checkObject ; Integer ancestorNumber = null ; String ancestorType = null ; // try to get relevant object if ( mappingValue . get ( MAPPING_VALUE_SOURCE ) . equals ( MtasParserMapping . SOURCE_OWN ) ) { checkObjects = new MtasParserObject [ ] { object } ; } else { ancestorNumber = mappingValue . get ( MAPPING_VALUE_ANCESTOR ) != null ? Integer . parseInt ( mappingValue . get ( MAPPING_VALUE_ANCESTOR ) ) : null ; ancestorType = computeTypeFromMappingSource ( mappingValue . get ( MAPPING_VALUE_SOURCE ) ) ; // get ancestor object if ( ancestorType != null ) { int s = currentList . get ( ancestorType ) . size ( ) ; // check existence ancestor for conditions if ( ancestorNumber != null ) { if ( ( s > 0 ) && ( ancestorNumber < s ) && ( checkObject = currentList . get ( ancestorType ) . get ( ( s - ancestorNumber - 1 ) ) ) != null ) { checkObjects = new MtasParserObject [ ] { checkObject } ; } } else { checkObjects = new MtasParserObject [ s ] ; for ( int i = s - 1 ; i >= 0 ; i -- ) { checkObjects [ s - i - 1 ] = currentList . get ( ancestorType ) . get ( i ) ; } } } } return checkObjects ; }
Compute object from mapping value .