Skip to content

Commit

Permalink
Fixed visibility of methods using the Pattern class
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Apr 1, 2013
1 parent ba8f4a3 commit 39d2063
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions parser-xml/src/main/java/org/jboss/forge/parser/xml/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* {@link Node} is a data structure representing a container in a classic tree. May sometimes be synonymous with the
* term "Element" in XML. It may contain a {@link Map} of attributes ({@link String}s), a reference to a {@link List} of
* child {@link Node}s, and text data.
*
*
* @author <a href="mailto:aslak@redhat.com">Aslak Knutsen</a>
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
* @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
Expand Down Expand Up @@ -72,7 +72,7 @@ public class Node

/**
* Creates a root {@link Node}
*
*
* @param name The name of the node
*/
public Node(final String name) throws IllegalArgumentException
Expand All @@ -82,7 +82,7 @@ public Node(final String name) throws IllegalArgumentException

/**
* Creates a {@link Node}
*
*
* @param name The name of the node
* @param parent The parent node. Use null to denote a root.
* @throws IllegalArgumentException If the name is not specified or contains any space characters
Expand Down Expand Up @@ -118,7 +118,7 @@ public Node(final String name, final Node parent) throws IllegalArgumentExceptio
* Add or override a named attribute.<br/>
* <br/>
* value will be converted to String using String.valueOf(value);
*
*
* @param name The attribute name
* @param value The given value
* @return This {@link Node}
Expand All @@ -131,7 +131,7 @@ public Node attribute(final String name, final Object value)

/**
* Add or override a named attribute.<br/>
*
*
* @param name The attribute name
* @param value The given value
* @return This {@link Node}
Expand All @@ -144,7 +144,7 @@ public Node attribute(final String name, final String value)

/**
* Get a named attribute.<br/>
*
*
* @param name The attribute name
* @return The attribute value or null of none defined.
*/
Expand All @@ -155,7 +155,7 @@ public String getAttribute(final String name)

/**
* Remove a named attribute.<br/>
*
*
* @param name The attribute name
* @return The attribute value that was removed, or null if the attribute with the given name was not found.
* @throws IllegalArgumentException If the name is not specified
Expand All @@ -174,7 +174,7 @@ public String removeAttribute(final String name) throws IllegalArgumentException

/**
* Get all defined attributes for this Node in an immutable view
*
*
* @return All defined attributes.
*/
public Map<String, String> getAttributes()
Expand All @@ -184,7 +184,7 @@ public Map<String, String> getAttributes()

/**
* Returns whether or not this {@link Node} represents a comment
*
*
* @return
*/
public boolean isComment()
Expand All @@ -194,7 +194,7 @@ public boolean isComment()

/**
* Marks this {@link Node} as a comment
*
*
* @param comment Whether or not this is a comment
* @return
* @throws IllegalArgumentException If this node has children
Expand All @@ -214,7 +214,7 @@ public void setComment(final boolean comment) throws IllegalArgumentException

/**
* Obtains the root {@link Node} for this reference
*
*
* @return
*/
public Node getRoot()
Expand All @@ -236,7 +236,7 @@ private Node getRoot(final Node start)

/**
* Returns whether or not this {@link Node} is a root
*
*
* @return
*/
public boolean isRoot()
Expand All @@ -252,7 +252,7 @@ public boolean isRoot()
* 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
Expand All @@ -269,7 +269,7 @@ public Node createChild(final String name) throws IllegalArgumentException
return createChild(Patterns.from(name));
}

public Node createChild(final Pattern... patterns)
Node createChild(final Pattern... patterns)
{
return CreateQuery.INSTANCE.execute(this, patterns);
}
Expand All @@ -278,7 +278,7 @@ public Node createChild(final Pattern... patterns)
* 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)
Expand All @@ -290,7 +290,7 @@ public Node getOrCreate(String name)
return getOrCreate(Patterns.from(name));
}

public Node getOrCreate(final Pattern... patterns)
Node getOrCreate(final Pattern... patterns)
{
return GetOrCreateQuery.INSTANCE.execute(this, includeRootPatternFirst(patterns));
}
Expand All @@ -299,7 +299,7 @@ public Node getOrCreate(final Pattern... patterns)
* 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.
Expand All @@ -309,14 +309,14 @@ public Node getSingle(String name)
return getSingle(Patterns.from(name));
}

public Node getSingle(final Pattern... patterns)
Node getSingle(final Pattern... patterns)
{
return AbsoluteGetSingleQuery.INSTANCE.execute(this, includeRootPatternFirst(patterns));
}

/**
* Get all children with a specific name.
*
*
* @param name The child node name.
* @return All found children, or empty list if none found.
*/
Expand All @@ -327,18 +327,18 @@ public List<Node> get(String name)

/**
* Get all children matching the specified query.
*
*
* @param query The query to use for finding relevant child nodes
* @return All found children, or empty list if none found.
*/
public List<Node> get(final Pattern... patterns)
List<Node> get(final Pattern... patterns)
{
return AbsoluteGetQuery.INSTANCE.execute(this, includeRootPatternFirst(patterns));
}

/**
* Remove all child nodes found at the given query.
*
*
* @return the {@link List} of removed children.
* @throws IllegalArgumentException If the specified name is not specified
*/
Expand All @@ -359,11 +359,11 @@ public List<Node> removeChildren(final String name) throws IllegalArgumentExcept

/**
* Remove all child nodes found at the given {@link Pattern}s.
*
*
* @return the {@link List} of removed children.
* @throws IllegalArgumentException If pattern is not specified
*/
public List<Node> removeChildren(final Pattern pattern, final Pattern... patterns)
List<Node> removeChildren(final Pattern pattern, final Pattern... patterns)
{
// Precondition check
final Pattern[] merged = this.validateAndMergePatternInput(pattern, patterns);
Expand All @@ -382,7 +382,7 @@ public List<Node> removeChildren(final Pattern pattern, final Pattern... pattern

/**
* Remove a single child from this {@link Node}
*
*
* @return true if this node contained the given child
*/
public boolean removeChild(final Node child)
Expand All @@ -392,7 +392,7 @@ public boolean removeChild(final Node child)

/**
* Remove a single child from this {@link Node}
*
*
* @return true if this node contained the given child
* @throws IllegalArgumentException if multiple children with name exist.
*/
Expand All @@ -414,7 +414,7 @@ public Node removeChild(final String name)
* Set the Nodes text body.<br/>
* <br/>
* text will be converted to String using String.valueOf(text);
*
*
* @param text
* @return
* @see #text(String)
Expand All @@ -426,7 +426,7 @@ public Node text(Object text)

/**
* Set the Nodes text body.
*
*
* @param text The text content
* @return This
*/
Expand All @@ -438,7 +438,7 @@ public Node text(String text)

/**
* Get the Nodes text body.
*
*
* @return Set body or null if none.
*/
public String getText()
Expand Down Expand Up @@ -478,7 +478,7 @@ public List<String> getTextValuesForPatternName(final String name)

/**
* Get the Nodes name.
*
*
* @return Given name.
*/
public String getName()
Expand All @@ -488,7 +488,7 @@ public String getName()

/**
* Get the Nodes parent.
*
*
* @return The given parent or null if root node.
*/
public Node getParent()
Expand All @@ -498,7 +498,7 @@ public Node getParent()

/**
* Get all the defined children for this node in an immutable view.
*
*
* @return All children or empty list if none.
*/
public List<Node> getChildren()
Expand All @@ -512,7 +512,7 @@ public List<Node> getChildren()

/**
* {@inheritDoc}
*
*
* @see java.lang.Object#toString()
*/
@Override
Expand All @@ -526,7 +526,7 @@ public String toString()

/**
* Returns a multiline {@link String} format of this {@link Node} and all children
*
*
* @param verbose
* @return
*/
Expand Down Expand Up @@ -580,7 +580,7 @@ private void appendNodeInfo(final StringBuilder builder, final int level, final

/**
* Validates that at least one pattern was specified, merges all patterns together, and returns the result
*
*
* @param pattern
* @param patterns
* @return
Expand Down

0 comments on commit 39d2063

Please sign in to comment.