|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.utils.xml.OldPolicyFormatCompat
public final class OldPolicyFormatCompat
This utility class provides helper methods to provide compatibility with the code that used attributes converted to elements by TAP design document v0.7. The class exactly adheres to the patterns used in the code. Hence the ability of this class to produce and consumes old data structures and comma separated lists in strings.
Method Summary | |
---|---|
static java.lang.String[] |
getAllowedActions(org.w3c.dom.Element targetElement)
Get the list of allowed actions on a target as an array. |
static java.util.List<java.lang.String> |
getAllowedActions(org.w3c.dom.Element target,
org.w3c.dom.Element actionPolicy)
Computes a List of the names of the allowed actions on the specified target element. |
static java.util.Enumeration<java.lang.String> |
getAllowedActionsEnumeration(org.w3c.dom.Element target,
org.w3c.dom.Element actionPolicy)
Gets an enumeration of the names of the allowed actions on a given target element. |
static java.lang.String |
getAllowedActionsOldFormat(org.w3c.dom.Element targetElement)
Get the list of allowed actions on a target in the old style format - as a comma delimited string. |
static java.lang.String |
getAllowedActionsOldFormat(org.w3c.dom.Element targetElement,
org.w3c.dom.Element actionPolicy)
Computes a string containing the list of the names allowed actions on a target in the old style format - as a comma delimited string. |
static java.lang.String |
getAllowedActionsOldFormat(PolicyXMLNode targetElement)
Get the list of allowed actions on a target in the old style format - as a comma delimited string. |
static java.lang.String |
getArgumentNamesOldFormat(org.w3c.dom.Element actionElment)
Get the list of argument names on an action in the old style format - as a comma delimited string. |
static java.lang.String |
getArgumentsOldFormat(PolicyXMLNode actionElement)
Get the list of argument names on an action in the old style format - comma delimited string. |
static java.lang.String |
getArgumentTypesOldFormat(org.w3c.dom.Element actionElment)
Get the list of argument types on an action in the old style format - as a comma delimited string. |
static java.util.List<java.lang.String> |
getIdFromName(org.w3c.dom.Element actionPolicy,
java.util.List<java.lang.String> names)
Computes a list of IDs corresponding to the given list of names. |
static java.lang.String |
getIdFromName(org.w3c.dom.Element actionPolicy,
java.lang.String name)
Returns the ID corresponding to a given action name. |
static java.lang.String[] |
getIDsOfAllowedActions(org.w3c.dom.Element targetElement)
Get the list of the IDs of the allowed actions on a target as an array. |
static java.lang.String[] |
getIDsOfAllowedActions(PolicyXMLNode targetNode)
Get the list of the IDs of the allowed actions on a target as an array. |
static java.lang.String |
getNameFromId(org.w3c.dom.Element actionPolicy,
java.lang.String id)
Computes the name of an action given its ID attribute according to a given ActionPolicy element. |
static java.lang.String |
getTargetDomainsOldFormat(org.w3c.dom.Element actionElement)
Get the list of target domains on an action in the old style format - as a comma delimited string. |
static void |
setActions(org.w3c.dom.Document document,
org.w3c.dom.Element targetElement,
java.lang.String commaSeparatedActions)
Create or update list of allowed actions on a target. |
static void |
setActions(org.w3c.dom.Document document,
org.w3c.dom.Element targetElement,
java.lang.String[] actions)
Create or update list of allowed actions on a target. |
static void |
setArguments(org.w3c.dom.Document document,
org.w3c.dom.Element actionElement,
java.lang.String[] args)
Create or update list of argument names on an action. |
static void |
setArguments(org.w3c.dom.Document document,
org.w3c.dom.Element parentElement,
java.lang.String args,
java.lang.String types)
Create or update list of arguments on an action. |
static void |
setTargetDomains(org.w3c.dom.Document document,
org.w3c.dom.Element actionElement,
java.lang.String targetDomainsCommaSeparated)
Set the list of targetdomains on an action using a comma separated string as parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String[] getAllowedActions(org.w3c.dom.Element targetElement)
targetElement
- the element to get the allowed actions for
public static java.lang.String[] getIDsOfAllowedActions(org.w3c.dom.Element targetElement)
targetElement
- the element to get the allowed actions for
public static java.lang.String[] getIDsOfAllowedActions(PolicyXMLNode targetNode)
targetNode
- the node to get the IDs of the allowed actions for
public static java.util.List<java.lang.String> getAllowedActions(org.w3c.dom.Element target, org.w3c.dom.Element actionPolicy)
target
- the specified Target elementactionPolicy
- the specified ActionPolicy element
public static java.lang.String getIdFromName(org.w3c.dom.Element actionPolicy, java.lang.String name)
actionPolicy
- an element representing the action policyname
- the name of the action for which the ID is to be looked up.
public static java.lang.String getNameFromId(org.w3c.dom.Element actionPolicy, java.lang.String id)
actionPolicy
- the ActionPolicy elementid
- the ID attribute of the action for which the name is to
be computed
public static java.util.List<java.lang.String> getIdFromName(org.w3c.dom.Element actionPolicy, java.util.List<java.lang.String> names)
actionPolicy
- an element representing the action policynames
- list of name attributes to look up. Should not be null.
public static java.util.Enumeration<java.lang.String> getAllowedActionsEnumeration(org.w3c.dom.Element target, org.w3c.dom.Element actionPolicy)
target
- the Target element for which to get the allowed actionsactionPolicy
- the ActionPolicy element to use to compute the mapping
from ID attributes to the actual action names
getAllowedActions(Element, Element)
public static java.lang.String getArgumentsOldFormat(PolicyXMLNode actionElement)
actionElement
- the element to get the arguments for
public static java.lang.String getAllowedActionsOldFormat(PolicyXMLNode targetElement)
targetElement
- the Target element to get the allowed actions for
public static java.lang.String getAllowedActionsOldFormat(org.w3c.dom.Element targetElement)
targetElement
- the Target element to get the allowed actions for
public static java.lang.String getAllowedActionsOldFormat(org.w3c.dom.Element targetElement, org.w3c.dom.Element actionPolicy)
targetElement
- the Target element to get the allowed actions foractionPolicy
- the ActionPolicy element used to get the action names from
the ID attributes
public static java.lang.String getArgumentNamesOldFormat(org.w3c.dom.Element actionElment)
actionElment
- the Action element to get the arguments for
public static java.lang.String getTargetDomainsOldFormat(org.w3c.dom.Element actionElement)
actionElement
- the Action element to get the targets for
public static void setTargetDomains(org.w3c.dom.Document document, org.w3c.dom.Element actionElement, java.lang.String targetDomainsCommaSeparated)
document
- parent documentactionElement
- The Action ElementtargetDomainsCommaSeparated
- separated list of target domainspublic static java.lang.String getArgumentTypesOldFormat(org.w3c.dom.Element actionElment)
actionElment
- the Action element to get the arguments for
public static void setActions(org.w3c.dom.Document document, org.w3c.dom.Element targetElement, java.lang.String commaSeparatedActions)
document
- parent documentactionElement
- the Target elementcommaSeparatedActions
- comma separated list of allowed actions
as specified by permispublic static void setActions(org.w3c.dom.Document document, org.w3c.dom.Element targetElement, java.lang.String[] actions)
document
- parent documentactionElement
- the Target elementargs
- array of argument namespublic static void setArguments(org.w3c.dom.Document document, org.w3c.dom.Element actionElement, java.lang.String[] args)
document
- parent documentactionElement
- the Action elementargs
- array of argument namespublic static void setArguments(org.w3c.dom.Document document, org.w3c.dom.Element parentElement, java.lang.String args, java.lang.String types)
document
- parent documentactionElement
- the Action elementargs
- comma separated list of argument namestypes
- comma separated list of type names
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |