@Test public void getReferencesTest() throws ParseException { String[] references = FormulaUtil.getReferences( "=CSVTEXT([parmTerritory];FALSE();\",\";\"'\")" ); assertTrue("References list is not empty", references.length > 0); assertEquals("Fromula has one reference to paramTerritory", "parmTerritory", references[0]); }
public static String[] getReferences( final String formula ) throws ParseException { if ( formula == null ) { throw new NullPointerException(); } final String formulaExpression = extractFormula( formula ); if ( formulaExpression == null ) { throw new ParseException( "Formula is invalid" ); } return getReferences( new Formula( formulaExpression ) ); }
FormulaUtil { public static String[] getReferences( final String formula ) throws ParseException { if ( formula == null ) { throw new NullPointerException(); } final String formulaExpression = extractFormula( formula ); if ( formulaExpression == null ) { throw new ParseException( "Formula is invalid" ); } return getReferences( new Formula( formulaExpression ) ); } }
FormulaUtil { public static String[] getReferences( final String formula ) throws ParseException { if ( formula == null ) { throw new NullPointerException(); } final String formulaExpression = extractFormula( formula ); if ( formulaExpression == null ) { throw new ParseException( "Formula is invalid" ); } return getReferences( new Formula( formulaExpression ) ); } private  FormulaUtil(); }
FormulaUtil { public static String[] getReferences( final String formula ) throws ParseException { if ( formula == null ) { throw new NullPointerException(); } final String formulaExpression = extractFormula( formula ); if ( formulaExpression == null ) { throw new ParseException( "Formula is invalid" ); } return getReferences( new Formula( formulaExpression ) ); } private  FormulaUtil(); static String quoteReference( final String reference ); static String quoteString( final String text ); static String[] getReferences( final String formula ); static String[] getReferences( final Formula formula ); static String extractFormula( final String formula ); static String extractStaticTextFromFormula( final String formula ); static String extractStaticTextFromFormulaFragment( final String formula ); static boolean isValidFormulaFragment( final String formula ); static String createCellUITextFromFormula( final String formula ); static String createCellUITextFromFormula( final String formula, final FormulaContext context ); static String createEditorTextFromFormula( final String formula,
                                                    final FormulaContext formulaContext ); static String createFormulaFromUIText( final String formula ); static String[] extractFormulaContext( String formula ); }
FormulaUtil { public static String[] getReferences( final String formula ) throws ParseException { if ( formula == null ) { throw new NullPointerException(); } final String formulaExpression = extractFormula( formula ); if ( formulaExpression == null ) { throw new ParseException( "Formula is invalid" ); } return getReferences( new Formula( formulaExpression ) ); } private  FormulaUtil(); static String quoteReference( final String reference ); static String quoteString( final String text ); static String[] getReferences( final String formula ); static String[] getReferences( final Formula formula ); static String extractFormula( final String formula ); static String extractStaticTextFromFormula( final String formula ); static String extractStaticTextFromFormulaFragment( final String formula ); static boolean isValidFormulaFragment( final String formula ); static String createCellUITextFromFormula( final String formula ); static String createCellUITextFromFormula( final String formula, final FormulaContext context ); static String createEditorTextFromFormula( final String formula,
                                                    final FormulaContext formulaContext ); static String createFormulaFromUIText( final String formula ); static String[] extractFormulaContext( String formula );  }