public class ReplaceInterfacesStorage extends Object
Constructor and Description |
---|
ReplaceInterfacesStorage(String replaceInterfacesStr)
Constructs a new storage with the given string.
|
Modifier and Type | Method and Description |
---|---|
String |
getBaseItemForItem(String item)
Returns the base item (root item) that is being replaced for the
given item.
|
Map<String,String> |
getMap()
Returns the replace map.
|
protected String |
getReplaceInterfaceParametersParameterName() |
String |
getStackTopByExistentItem(String item)
Returns the top of replace stack by a given item.
|
String |
getStateString()
Returns the state of replace interface information as a string in the format for
PortalRequestParameters.PAGE_PARAMETER_REPLACE_INTERFACES_STATE . |
String |
handleReplaceInterfaceOperations(String currentInterfaceInstanceId,
String[] replaceInterfaceOperations,
PortalRequestParameters parameters)
Handles the replace interface commands.
|
String |
put(String source,
String target)
Creates a new replace mapping
source -> target . |
String |
remove(String item)
Removes the given interface instance from the replace map (searching it as the mapping key).
|
public ReplaceInterfacesStorage(String replaceInterfacesStr) throws UnsupportedEncodingException
The string must be formatted as following:
originInterfaceInstance=destinationInterfaceInstance(;originInterfaceInstance=destinationInterfaceInstance)*
Where:
originInterfaceInstance
is the original interface instance.
destinationInterfaceInstance
is the interface instance that is replacing the original one.
null
or empty no interface instance is being replaced.replaceInterfacesStr
- the string of replaces.UnsupportedEncodingException
public String getStateString()
PortalRequestParameters.PAGE_PARAMETER_REPLACE_INTERFACES_STATE
.PortalRequestParameters.PAGE_PARAMETER_REPLACE_INTERFACES_STATE
.public Map<String,String> getMap()
public String getStackTopByExistentItem(String item)
item
- the item used to search in the map.public String getBaseItemForItem(String item)
item
- the item used to search in the map.public String remove(String item)
item
- the item to be removed.Map.remove(Object)
.public String put(String source, String target)
source
-> target
.source
- the interface instance that is going to be replaced.target
- the interface instance that is going to replace.Map.put(Object, Object)
.public String handleReplaceInterfaceOperations(String currentInterfaceInstanceId, String[] replaceInterfaceOperations, PortalRequestParameters parameters) throws PortalException
PortalRequestParameters
if needed. Returns the result interface instance after
the commands are applied. The commands are formatted in a string array. Each command string may have multiple commands separated by a ',
' character.
The supported commands are:
r
: removes the current interface instance from the replaces map. After this command is executed, the current interface instance becomes the one that it was replacing.r
is executed, the current interface instance becomes II-1.
a
: this command adds a new replace mapping. It must be followed by the interface instance that is going to replace the current interface instance. After this command is
executed, the current interface instance becomes the given one.aII-2
is executed, the interface instance II-2 replaces the interface instance II-1
and II-2 becomes the current interface instance.
currentInterfaceInstanceId
- the current interface instance.replaceInterfaceOperations
- the replace commands array.parameters
- the replace interface parameters.PortalException
protected String getReplaceInterfaceParametersParameterName()
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.