public static IDecoratorComponent[][] compileFormatString(String format){
  int length=format.length();
  int start=-1;
  int end=length;
  boolean isPrefix=true;
  ArrayList prefix=new ArrayList();
  ArrayList suffix=new ArrayList();
  while ((start + 1) < length) {
    if ((end=format.indexOf('{',start)) > -1) {
      if (start + 1 != end) {
        IDecoratorComponent component=new ConstantValueDecoratorComponent(format.substring(start + 1,end));
        if (isPrefix) {
          prefix.add(component);
        }
 else {
          suffix.add(component);
        }
      }
      if ((start=format.indexOf('}',end)) > -1) {
        String key=format.substring(end + 1,start);
        if (key.equals(RESOURCE_NAME)) {
          isPrefix=false;
        }
 else {
          IDecoratorComponent component=new MappedValueDecoratorComponent(key);
          if (isPrefix) {
            prefix.add(component);
          }
 else {
            suffix.add(component);
          }
        }
      }
 else {
        IDecoratorComponent component=new ConstantValueDecoratorComponent(format.substring(end));
        if (isPrefix) {
          prefix.add(component);
        }
 else {
          suffix.add(component);
        }
        break;
      }
    }
 else {
      IDecoratorComponent component=new ConstantValueDecoratorComponent(format.substring(start + 1));
      if (isPrefix) {
        prefix.add(component);
      }
 else {
        suffix.add(component);
      }
      break;
    }
  }
  return new IDecoratorComponent[][]{(IDecoratorComponent[])prefix.toArray(new IDecoratorComponent[prefix.size()]),(IDecoratorComponent[])suffix.toArray(new IDecoratorComponent[suffix.size()])};
}

public static IDecoratorComponent [ ] [ ] compileFormatString ( String format ) { int length = format . length ( ) ; int start = - 1 ; int end = length ; boolean isPrefix = true ; ArrayList prefix = new ArrayList ( ) ; ArrayList suffix = new ArrayList ( ) ; while ( ( start + 1 ) < length ) { if ( ( end = format . indexOf ( '{' , start ) ) > - 1 ) { if ( start + 1 != end ) { IDecoratorComponent component = new ConstantValueDecoratorComponent ( format . substring ( start + 1 , end ) ) ; if ( isPrefix ) { prefix . add ( component ) ; } else { suffix . add ( component ) ; } } if ( ( start = format . indexOf ( '}' , end ) ) > - 1 ) { String key = format . substring ( end + 1 , start ) ; if ( key . equals ( RESOURCE_NAME ) ) { isPrefix = false ; } else { IDecoratorComponent component = new MappedValueDecoratorComponent ( key ) ; if ( isPrefix ) { prefix . add ( component ) ; } else { suffix . add ( component ) ; } } } else { IDecoratorComponent component = new ConstantValueDecoratorComponent ( format . substring ( end ) ) ; if ( isPrefix ) { prefix . add ( component ) ; } else { suffix . add ( component ) ; } break ; } } else { IDecoratorComponent component = new ConstantValueDecoratorComponent ( format . substring ( start + 1 ) ) ; if ( isPrefix ) { prefix . add ( component ) ; } else { suffix . add ( component ) ; } break ; } } return new IDecoratorComponent [ ] [ ] { ( IDecoratorComponent [ ] ) prefix . toArray ( new IDecoratorComponent [ prefix . size ( ) ] ) , ( IDecoratorComponent [ ] ) suffix . toArray ( new IDecoratorComponent [ suffix . size ( ) ] ) } ; }
creates a list of prefix and suffix decorator components
