private void parseValue ( StringBuffer res , HashMap < String , String > predefs , char preDelim , HashMap < String , String > valids ) { int len = res . length ( ) ; if ( preDelim != ( char ) 0 && res . charAt ( 0 ) != preDelim ) { if ( len == 0 ) { throw new ParseErrorException ( HBCIUtils . getLocMsg ( "EXCMSG_ENDOFSTRG" , getPath ( ) ) ) ; } // log.("error string: "+res.toString(),log._ERR); // log.("current: "+getPath()+":"+type+"("+minsize+","+maxsize+")="+value,log._ERR); // log.("predelimiter mismatch (required:"+getPreDelim()+" found:"+temp.charAt(0)+")",log._ERR); throw new PredelimErrorException ( getPath ( ) , Character . toString ( preDelim ) , Character . toString ( res . charAt ( 0 ) ) ) ; } this . value = SyntaxDEFactory . createSyntaxDE ( getType ( ) , getPath ( ) , res , minsize , maxsize ) ; String valueString = value . toString ( 0 ) ; String predefined = predefs . get ( getPath ( ) ) ; if ( predefined != null ) { if ( ! valueString . equals ( predefined ) ) { throw new ParseErrorException ( HBCIUtils . getLocMsg ( "EXCMSG_PREDEFERR" , new Object [ ] { getPath ( ) , predefined , value } ) ) ; } } boolean atLeastOne = false ; boolean ok = false ; if ( valids != null ) { String header = getPath ( ) + ".value" ; for ( String key : valids . keySet ( ) ) { if ( key . startsWith ( header ) && key . indexOf ( "." , header . length ( ) ) == - 1 ) { atLeastOne = true ; String validValue = valids . get ( key ) ; if ( valueString . equals ( validValue ) ) { ok = true ; break ; } } } } if ( atLeastOne && ! ok ) { throw new NoValidValueException ( getPath ( ) , valueString ) ; } }
anlegen eines de beim parsen funktioniert analog zum anlegen eines de bei der message - synthese