private String parseFormatDescription ( final String pattern , final ParsePosition pos ) { final int start = pos . getIndex ( ) ; seekNonWs ( pattern , pos ) ; final int text = pos . getIndex ( ) ; int depth = 1 ; for ( ; pos . getIndex ( ) < pattern . length ( ) ; next ( pos ) ) { switch ( pattern . charAt ( pos . getIndex ( ) ) ) { case START_FE : depth ++ ; break ; case END_FE : depth -- ; if ( depth == 0 ) { return pattern . substring ( text , pos . getIndex ( ) ) ; } break ; case QUOTE : getQuotedString ( pattern , pos ) ; break ; default : break ; } } throw new IllegalArgumentException ( "Unterminated format element at position " + start ) ; }
Parse the format component of a format element .