/** * This is used to register a <code>Model</code> for this builder. * Registration of a model creates a tree of models that is used * to represent an XML structure. Each model can contain elements * and attributes associated with a type. * * @param path this is the path of the model to be resolved * * @return this returns the model that was registered */ private Model register(Expression path) throws Exception { Model model = root.lookup(path); if (model != null) { return model; } return create(path); }
/** * This is used to register a <code>Model</code> for this builder. * Registration of a model creates a tree of models that is used * to represent an XML structure. Each model can contain elements * and attributes associated with a type. * * @param path this is the path of the model to be resolved * * @return this returns the model that was registered */ private Model register(Expression path) throws Exception { Model model = root.lookup(path); if (model != null) { return model; } return create(path); }
/** * This is used to register a <code>Model</code> for this builder. * Registration of a model creates a tree of models that is used * to represent an XML structure. Each model can contain elements * and attributes associated with a type. * * @param path this is the path of the model to be resolved * * @return this returns the model that was registered */ private Model register(Expression path) throws Exception { Model model = root.lookup(path); if (model != null) { return model; } return create(path); }
/** * This method is used to look for a <code>Model</code> that * matches the specified expression. If no such model exists * then this will return null. Using an XPath expression allows * a tree like structure to be navigated with ease. * * @param path an XPath expression used to locate a model * * @return this returns the model located by the expression */ private Model lookup(Expression path) throws Exception { Expression target = path.getPath(0, 1); if(path.isPath()) { return root.lookup(target); } return root; }
/** * This method is used to look for a <code>Model</code> that * matches the specified expression. If no such model exists * then this will return null. Using an XPath expression allows * a tree like structure to be navigated with ease. * * @param path an XPath expression used to locate a model * * @return this returns the model located by the expression */ private Model lookup(Expression path) throws Exception { Expression target = path.getPath(0, 1); if(path.isPath()) { return root.lookup(target); } return root; }
/** * This method is used to look for a <code>Model</code> that * matches the specified expression. If no such model exists * then this will return null. Using an XPath expression allows * a tree like structure to be navigated with ease. * * @param path an XPath expression used to locate a model * * @return this returns the model located by the expression */ private Model lookup(Expression path) throws Exception { Expression target = path.getPath(0, 1); if(path.isPath()) { return root.lookup(target); } return root; }
/** * This method is used to look for a <code>Model</code> that * matches the specified expression. If no such model exists * then this will return null. Using an XPath expression allows * a tree like structure to be navigated with ease. * * @param path an XPath expression used to locate a model * * @return this returns the model located by the expression */ public Model lookup(Expression path) { String name = path.getFirst(); int index = path.getIndex(); Model model = lookup(name, index); if(path.isPath()) { path = path.getPath(1, 0); if(model != null) { return model.lookup(path); } } return model; }
/** * This method is used to look for a <code>Model</code> that * matches the specified expression. If no such model exists * then this will return null. Using an XPath expression allows * a tree like structure to be navigated with ease. * * @param path an XPath expression used to locate a model * * @return this returns the model located by the expression */ public Model lookup(Expression path) { String name = path.getFirst(); int index = path.getIndex(); Model model = lookup(name, index); if(path.isPath()) { path = path.getPath(1, 0); if(model != null) { return model.lookup(path); } } return model; }
/** * This method is used to look for a <code>Model</code> that * matches the specified expression. If no such model exists * then this will return null. Using an XPath expression allows * a tree like structure to be navigated with ease. * * @param path an XPath expression used to locate a model * * @return this returns the model located by the expression */ public Model lookup(Expression path) { String name = path.getFirst(); int index = path.getIndex(); Model model = lookup(name, index); if(path.isPath()) { path = path.getPath(1, 0); if(model != null) { return model.lookup(path); } } return model; }
Model previous = model.lookup(name, index -1);
Model previous = model.lookup(name, index -1);
Model previous = model.lookup(name, index -1);
Model element = model.lookup(name, index);
Model element = model.lookup(name, index);
Model element = model.lookup(name, index);