/** * Get all children with a specific name. * * @param name * The child node name. * @return All found children, or empty list if none found. */ public List<Node> get(String name) { return get(Patterns.from(name)); }
/** * Get all children with a specific name. * * @param name * The child node name. * @return All found children, or empty list if none found. */ public List<Node> get(String name) { return get(Patterns.from(name)); }
/** * Get a single child node.<br/> * <br/> * If multiple children are found with same name it is considered a IllegalArgumentException. * * @param name * The child node name * @return The named child node or null if non found * @throws IllegalArgumentException * if multiple children with name exists. */ public Node getSingle(String name) { return getSingle(Patterns.from(name)); }
/** * Get a single child node.<br/> * <br/> * If multiple children are found with same name it is considered a IllegalArgumentException. * * @param name * The child node name * @return The named child node or null if non found * @throws IllegalArgumentException * if multiple children with name exists. */ public Node getSingle(String name) { return getSingle(Patterns.from(name)); }
/** * Get or create a named child node. <br/> * <br/> * If a named node is found using {@link #getSingle(String)} it is returned, else a new child node is created. * * @param name * The child node name. * @return The existing node or a new node, never null. * @see #getSingle(String) * @see #createChild(String) * @throws IllegalArgumentException * if multiple children with name exists. */ public Node getOrCreate(String name) { return getOrCreate(Patterns.from(name)); }
/** * Get or create a named child node. <br/> * <br/> * If a named node is found using {@link #getSingle(String)} it is returned, else a new child node is created. * * @param name * The child node name. * @return The existing node or a new node, never null. * @see #getSingle(String) * @see #createChild(String) * @throws IllegalArgumentException * if multiple children with name exists. */ public Node getOrCreate(String name) { return getOrCreate(Patterns.from(name)); }
/** * Create a new {@link Node} with given name. <br/> * <br/> * The new {@link Node} will have this as parent. * * @param name * The name of the {@link Node}. * @return A new child {@link Node} * @throws IllegalArgumentException * If the name is not specified */ public Node createChild(final String name) throws IllegalArgumentException { // Precondition checks if (name == null || name.trim().length() == 0) { throw new IllegalArgumentException("name must be specified"); } // Create return createChild(Patterns.from(name)); }
/** * Create a new {@link Node} with given name. <br/> * <br/> * The new {@link Node} will have this as parent. * * @param name * The name of the {@link Node}. * @return A new child {@link Node} * @throws IllegalArgumentException * If the name is not specified */ public Node createChild(final String name) throws IllegalArgumentException { // Precondition checks if (name == null || name.trim().length() == 0) { throw new IllegalArgumentException("name must be specified"); } // Create return createChild(Patterns.from(name)); }