protected String placeHolderTranslation(String value,
            Map<String,String> metainfo, XmlObject xmlbean) {
        int k, i, n;
        StringBuffer sb = new StringBuffer();
        n = value.length();
        for (i=0; i<n; i++) {
            char ch = value.charAt(i);
            if (ch=='{') {
                k = i+1;
                while (k<n) {
                    ch = value.charAt(k);
                    if (ch=='}') break;
                    k++;
                }
                if (k<n) {
                    String placeHolder = value.substring(i+1,k);
                    String v;
                    if (placeHolder.charAt(0)=='$') {
                        v = metainfo.get(placeHolder.substring(1));
                    } else {        // assume is an XPath expression
                        v = XmlPath.evaluate(xmlbean, placeHolder);
                    }
                    if (v!=null) sb.append(v);
                } // else  '{' without '}' - ignore string after '{'
                i = k;
            } else sb.append(ch);
        }
        return sb.toString();
    }
protected String placeHolderTranslation ( String value , Map < String , String > metainfo , XmlObject xmlbean ) { int k , i , n ; StringBuffer sb = new StringBuffer ( ) ; n = value . length ( ) ; for ( i = 0 ; i < n ; i ++ ) { char ch = value . charAt ( i ) ; if ( ch == '{' ) { k = i + 1 ; while ( k < n ) { ch = value . charAt ( k ) ; if ( ch == '}' ) break ; k ++ ; } if ( k < n ) { String placeHolder = value . substring ( i + 1 , k ) ; String v ; if ( placeHolder . charAt ( 0 ) == '$' ) { v = metainfo . get ( placeHolder . substring ( 1 ) ) ; } else { v = XmlPath . evaluate ( xmlbean , placeHolder ) ; } if ( v != null ) sb . append ( v ) ; } i = k ; } else sb . append ( ch ) ; } return sb . toString ( ) ; }
This method replaces place holders embedded in the given value
by either meta parameter or XPath expression operated on the
given XML Bean. Meta parameter is identified by a "$" followed
by the parameter name.
@param value
@param metainfo
@return