@Test public void testParse() { int originalSize = mExprModel.size(); mLayoutBinder.addVariable("user", "android.databinding.tool2.LayoutBinderTest.TestUser", null); mLayoutBinder.parse("user.name", false, null); mLayoutBinder.parse("user.lastName", false, null); assertEquals(originalSize + 3, mExprModel.size()); final List<Expr> bindingExprs = mExprModel.getBindingExpressions(); assertEquals(2, bindingExprs.size()); IdentifierExpr id = mExprModel.identifier("user"); assertTrue(bindingExprs.get(0) instanceof FieldAccessExpr); assertTrue(bindingExprs.get(1) instanceof FieldAccessExpr); assertEquals(2, id.getParents().size()); assertTrue(bindingExprs.get(0).getChildren().contains(id)); assertTrue(bindingExprs.get(1).getChildren().contains(id)); }
public Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile) { final Expr parsed = mExpressionParser.parse(input, locationInFile); parsed.setBindingExpression(true); parsed.setTwoWay(isTwoWay); return parsed; }
LayoutBinder implements FileScopeProvider { public Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile) { final Expr parsed = mExpressionParser.parse(input, locationInFile); parsed.setBindingExpression(true); parsed.setTwoWay(isTwoWay); return parsed; } }
LayoutBinder implements FileScopeProvider { public Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile) { final Expr parsed = mExpressionParser.parse(input, locationInFile); parsed.setBindingExpression(true); parsed.setTwoWay(isTwoWay); return parsed; } LayoutBinder(ResourceBundle.LayoutFileBundle layoutBundle); }
LayoutBinder implements FileScopeProvider { public Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile) { final Expr parsed = mExpressionParser.parse(input, locationInFile); parsed.setBindingExpression(true); parsed.setTwoWay(isTwoWay); return parsed; } LayoutBinder(ResourceBundle.LayoutFileBundle layoutBundle); void resolveWhichExpressionsAreUsed(); IdentifierExpr addVariable(String name, String type, Location location,
            boolean declared); HashMap<String, String> getUserDefinedVariables(); BindingTarget createBindingTarget(ResourceBundle.BindingTargetBundle targetBundle); Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile); List<BindingTarget> getBindingTargets(); List<BindingTarget> getSortedTargets(); boolean isEmpty(); ExprModel getModel(); void sealModel(); String writeViewBinderBaseClass(boolean forLibrary); String writeViewBinder(int minSdk); String getPackage(); boolean isMerge(); String getModulePackage(); String getLayoutname(); String getImplementationName(); String getClassName(); String getTag(); boolean hasVariations(); @Override String provideScopeFilePath(); }
LayoutBinder implements FileScopeProvider { public Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile) { final Expr parsed = mExpressionParser.parse(input, locationInFile); parsed.setBindingExpression(true); parsed.setTwoWay(isTwoWay); return parsed; } LayoutBinder(ResourceBundle.LayoutFileBundle layoutBundle); void resolveWhichExpressionsAreUsed(); IdentifierExpr addVariable(String name, String type, Location location,
            boolean declared); HashMap<String, String> getUserDefinedVariables(); BindingTarget createBindingTarget(ResourceBundle.BindingTargetBundle targetBundle); Expr parse(String input, boolean isTwoWay, @Nullable Location locationInFile); List<BindingTarget> getBindingTargets(); List<BindingTarget> getSortedTargets(); boolean isEmpty(); ExprModel getModel(); void sealModel(); String writeViewBinderBaseClass(boolean forLibrary); String writeViewBinder(int minSdk); String getPackage(); boolean isMerge(); String getModulePackage(); String getLayoutname(); String getImplementationName(); String getClassName(); String getTag(); boolean hasVariations(); @Override String provideScopeFilePath();  }