public final class CommandHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CURRENT_NODE_KEY
Current node key
|
static String |
OUTPUT_KEY
output key
|
static String |
REPO_ADDRESS_KEY
address key
|
static String |
REPOSITORY_KEY
repository key
|
static String |
SESSION_KEY
session key
|
| Modifier and Type | Method and Description |
|---|---|
static ResourceBundle |
getBundle() |
static Node |
getCurrentNode(org.apache.commons.chain.Context ctx)
Gets the current working
Node |
static Item |
getItem(org.apache.commons.chain.Context ctx,
String path)
Gets the
Item at the given path. |
static Iterator<Item> |
getItems(org.apache.commons.chain.Context ctx,
Node node,
String pattern)
Gets the
Items under the given Node that
match the pattern |
static Node |
getNode(org.apache.commons.chain.Context ctx,
String path)
Gets the
Node at the given path. |
static NodeIterator |
getNodes(org.apache.commons.chain.Context ctx,
Node node,
String pattern)
Gets the
Node s under the given Node that
match the given pattern. |
static PrintWriter |
getOutput(org.apache.commons.chain.Context ctx)
Gets the current
PrintWriter |
static PropertyIterator |
getProperties(org.apache.commons.chain.Context ctx,
Node node,
String pattern)
Gets the
Property s under the current working node for the
given pattern |
static Repository |
getRepository(org.apache.commons.chain.Context ctx)
Gets the current working
Repository |
static String |
getRepositoryAddress(org.apache.commons.chain.Context ctx) |
static Session |
getSession(org.apache.commons.chain.Context ctx)
Gets the current working
Session |
static boolean |
hasNode(org.apache.commons.chain.Context ctx,
String path)
Checks
Node existence. |
static void |
setCurrentNode(org.apache.commons.chain.Context ctx,
Node node)
Sets the current working
Node. |
static void |
setOutput(org.apache.commons.chain.Context ctx,
PrintWriter out)
Sets the current
PrintWriter. |
static void |
setRepository(org.apache.commons.chain.Context ctx,
Repository repository,
String address)
Sets the current working
Repository |
static void |
setSession(org.apache.commons.chain.Context ctx,
Session session)
Sets the current working
Session |
public static final String CURRENT_NODE_KEY
public static final String REPOSITORY_KEY
public static final String SESSION_KEY
public static final String OUTPUT_KEY
public static final String REPO_ADDRESS_KEY
public static void setOutput(org.apache.commons.chain.Context ctx,
PrintWriter out)
PrintWriter.ctx - the Contextout - the PrintWriterpublic static void setCurrentNode(org.apache.commons.chain.Context ctx,
Node node)
Node.ctx - the Contextnode - the current working Node.public static void setRepository(org.apache.commons.chain.Context ctx,
Repository repository,
String address)
Repositoryctx - the Contextrepository - the current working Repositorypublic static void setSession(org.apache.commons.chain.Context ctx,
Session session)
throws CommandException
Sessionctx - the Contextsession - the current working SessionCommandException - if there's an open working Sessionpublic static PrintWriter getOutput(org.apache.commons.chain.Context ctx)
PrintWriterctx - the ContextPrintWriterpublic static Node getCurrentNode(org.apache.commons.chain.Context ctx) throws CommandException
Nodectx - the ContextNodeCommandException - if the current working Node can't be found.public static Repository getRepository(org.apache.commons.chain.Context ctx) throws CommandException
Repositoryctx - the ContextRepositoryCommandException - if the current working Repository is unset.public static String getRepositoryAddress(org.apache.commons.chain.Context ctx) throws CommandException
CommandExceptionpublic static Session getSession(org.apache.commons.chain.Context ctx) throws CommandException
Sessionctx - the ContextSessionCommandException - if the current working Session is unset.public static Node getNode(org.apache.commons.chain.Context ctx, String path) throws CommandException, RepositoryException
Node at the given path.ctx - the Contextpath - the path to the NodeNode at the given pathCommandException - if the Node isn't found.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static Item getItem(org.apache.commons.chain.Context ctx, String path) throws CommandException, PathNotFoundException, RepositoryException
Item at the given path. Node.ctx - the Contextpath - the path to the ItemItem at the given pathCommandException - if a Command internal error occurs.PathNotFoundException - if there's no Node at the given path.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static boolean hasNode(org.apache.commons.chain.Context ctx,
String path)
throws CommandException,
RepositoryException
Node existence.ctx - the Contextpath - the path to the NodeNode exists at the given pathCommandException - if the current working Session is unset.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static NodeIterator getNodes(org.apache.commons.chain.Context ctx, Node node, String pattern) throws RepositoryException
Node s under the given Node that
match the given pattern.ctx - the Contextnode - the parent Nodepattern - the patternIterator that contains the matching nodesRepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static PropertyIterator getProperties(org.apache.commons.chain.Context ctx, Node node, String pattern) throws RepositoryException
Property s under the current working node for the
given patternctx - the Contextnode - the parent Nodepattern - the patternPropertyIteratorRepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static ResourceBundle getBundle()
ResourceBundlepublic static Iterator<Item> getItems(org.apache.commons.chain.Context ctx, Node node, String pattern) throws RepositoryException
Items under the given Node that
match the patternctx - the Contextnode - the parent Nodepattern - the patternIterator with the Item s that
match the given pattern.RepositoryException - if the underlying repository throws a
RepositoryExceptionCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.