Package com.microstrategy.web.tags
Class ReplaceTagImpl
- java.lang.Object
-
- com.microstrategy.web.tags.TagImpl
-
- com.microstrategy.web.tags.ReplaceTagImpl
-
- All Implemented Interfaces:
DynamicTag
,EnumHTMLTags
,LayoutParserAware
,ReplaceTag
,Tag
,java.io.Serializable
public class ReplaceTagImpl extends TagImpl implements ReplaceTag
- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
resolvedMethodName
-
Fields inherited from interface com.microstrategy.web.tags.DynamicTag
ATTR_NAME_METHOD, ATTR_NAME_METHOD_BASE, ATTR_NAME_NAME, METHOD_SOURCE_BEAN, METHOD_SOURCE_BEAN_NAME, METHOD_SOURCE_OBJECT, METHOD_SOURCE_TRANSFORM, METHOD_SOURCE_TRANSFORM_NAME
-
Fields inherited from interface com.microstrategy.web.tags.EnumHTMLTags
ATT_ACTION, ATT_ALIGN, ATT_ALT, ATT_AUTOCOMPLETE, ATT_BORDER, ATT_CELLPADDING, ATT_CELLSPACING, ATT_CHECKED, ATT_CLASS, ATT_CMD_FORMAT_TYPE, ATT_CMDID, ATT_CMDLVL, ATT_COLS, ATT_COLSPAN, ATT_DG, ATT_DIALOG, ATT_DISABLED, ATT_FOR, ATT_HEIGHT, ATT_HREF, ATT_HSPACE, ATT_ID, ATT_IFRAME, ATT_LANGUAGE, ATT_MAXLENGTH, ATT_METHOD, ATT_MODAL, ATT_NAME, ATT_NOWRAP, ATT_ONCHANGE, ATT_ONCLICK, ATT_ONFOCUS, ATT_ONKEYDOWN, ATT_ONKEYUP, ATT_ONMOUSEOUT, ATT_ONMOUSEOVER, ATT_ONSUBMIT, ATT_PARAM, ATT_PLACEHOLDER, ATT_READONLY, ATT_REL, ATT_ROWS, ATT_ROWSPAN, ATT_SCRIPT_CLASS, ATT_SELECTED, ATT_SIZE, ATT_SRC, ATT_STYLE, ATT_SUMMARY, ATT_TARGET, ATT_TITLE, ATT_TY, ATT_TYPE, ATT_VALIGN, ATT_VALUE, ATT_VALUE_ABSBOTTOM, ATT_VALUE_ABSMIDDLE, ATT_VALUE_BOTTOM, ATT_VALUE_BUTTON, ATT_VALUE_CHECKBOX, ATT_VALUE_DEFAULT, ATT_VALUE_EMBED, ATT_VALUE_FALSE, ATT_VALUE_HIDDEN, ATT_VALUE_IMAGE, ATT_VALUE_JAVASCRIPT, ATT_VALUE_LEFT, ATT_VALUE_MAX, ATT_VALUE_MIDDLE, ATT_VALUE_MIN, ATT_VALUE_NUMBER, ATT_VALUE_POST, ATT_VALUE_RADIO, ATT_VALUE_SUBMIT, ATT_VALUE_TEXT, ATT_VALUE_TOP, ATT_VALUE_TRUE, ATT_VSPACE, ATT_WIDTH, TAG_NAME_ANCHOR, TAG_NAME_CELL, TAG_NAME_DIV, TAG_NAME_HEADER, TAG_NAME_IFRAME, TAG_NAME_IMAGE, TAG_NAME_INPUT, TAG_NAME_LABEL, TAG_NAME_MAP, TAG_NAME_OPTION, TAG_NAME_ROW, TAG_NAME_SCRIPT, TAG_NAME_SELECT, TAG_NAME_SPAN, TAG_NAME_STYLE, TAG_NAME_TABLE, TAG_NAME_TBODY, TAG_NAME_TEXTAREA, TAG_NAME_THEAD
-
Fields inherited from interface com.microstrategy.web.tags.ReplaceTag
ATTR_NAME_SLOT_NAME, TAG_NAME_REPLACE
-
-
Constructor Summary
Constructors Constructor Description ReplaceTagImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArgument(ArgumentTag tag)
Adds anArgumentTag
as a child of the current tag.Tag
addChild(Tag tag)
Adds a child tag.void
addOnException(OnExceptionTag tag)
Adds anOnExceptionTag
as a child of the current tag.void
childrenAdded()
java.util.Enumeration
getArguments()
Returns anEnumeration
over all the arguments of the method from which the dynamic contents are generated.protected java.util.List
getCachedArguments()
protected java.util.List
getExceptions()
protected java.lang.Object[]
getInvocationArguments(MarkupOutput markup, LayoutContext context)
protected java.lang.Object[]
getInvocationArgumentsFromContext(MarkupOutput markup, LayoutContext context)
java.lang.String
getMethodName()
Returns the method name from which the dynamic contents are generated.protected java.lang.Class[]
getMethodParameters()
This method returns the array of method parameter class.protected java.lang.Class[]
getMethodParametersFromContext(LayoutContext context)
This method returns the method parameters class array from context.int
getMethodSource()
Returns the method source in which the method is defined.java.util.Enumeration
getOnExceptions()
Returns anEnumeration
over all the exception tags associated with the method from which the dynamic contents are generated.protected java.lang.String
getResolvedMethodName()
java.lang.String
getSlotName()
Returns the name of the slot attribute It is actually the value of the attributeReplaceTag.ATTR_NAME_SLOT_NAME
.java.lang.Object
invokeMethod(MarkupOutput markup, LayoutContext context)
Invokes the method to generate the dynamic contents.void
replaceSlot(LayoutTag layoutTag)
Replace the slot content which has the same name in the included layout with the content of the replaceTagvoid
setAttribute(java.lang.String attrName, java.lang.String attrValue)
Sets a new value to the attribute with the specified attribute name.void
setMethodName(java.lang.String methodName)
Sets the method name from which the dynamic contents are generated.void
setMethodSource(java.lang.String source)
Sets the method source in which the method is defined.protected void
setMethodSourceInternal(int source)
void
setSlotName(java.lang.String slotName)
Sets the name of the slot attribute It is actually the value of the attributeReplaceTag.ATTR_NAME_SLOT_NAME
.-
Methods inherited from class com.microstrategy.web.tags.TagImpl
addChild, addChild, addTextChild, addTextChild, checkEmptyString, checkModifiable, checkNullObject, doEndTag, doStartTag, generateErrorMessage, getAttribute, getAttributeNames, getAttributeNamesCollection, getAttributesCollection, getChildren, getChildrenCollection, getContent, getCssClass, getDeepCopy, getDynamicAttributesCollection, getId, getLineNumber, getPreserveCase, getRootTag, getSealed, getStyle, getTagName, isClosedRequired, isContentInline, isDynamic, removeAttribute, removeChildren, render, render, renderAllAttributes, renderChildTags, renderCloseTag, renderCloseTag, renderOpenTag, renderOpenTag, replaceContent, setAttributes, setCssClass, setDynamic, setDynamicInternal, setId, setIsClosedRequired, setIsContentInline, setLineNumber, setPreserveCase, setRootTag, setSealed, setStyle, setTagName, shouldCloseTag
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.tags.DynamicTag
addArgument, addOnException, getArguments, getMethodName, getMethodSource, getOnExceptions, invokeMethod, setMethodName, setMethodSource
-
Methods inherited from interface com.microstrategy.web.tags.Tag
addChild, addChild, addChild, addTextChild, addTextChild, doEndTag, doStartTag, getAttribute, getAttributeNames, getChildren, getContent, getCssClass, getDeepCopy, getId, getLineNumber, getPreserveCase, getRootTag, getSealed, getStyle, getTagName, isClosedRequired, isContentInline, isDynamic, removeChildren, render, render, renderCloseTag, renderOpenTag, renderOpenTag, replaceContent, setAttribute, setAttributes, setCssClass, setDynamic, setId, setIsClosedRequired, setIsContentInline, setLineNumber, setPreserveCase, setRootTag, setSealed, setStyle, setTagName
-
-
-
-
Method Detail
-
getSlotName
public java.lang.String getSlotName()
Returns the name of the slot attribute It is actually the value of the attributeReplaceTag.ATTR_NAME_SLOT_NAME
.- Specified by:
getSlotName
in interfaceReplaceTag
- Returns:
- the value of the attribute
ReplaceTag.ATTR_NAME_SLOT_NAME
.
-
setSlotName
public void setSlotName(java.lang.String slotName)
Sets the name of the slot attribute It is actually the value of the attributeReplaceTag.ATTR_NAME_SLOT_NAME
.- Specified by:
setSlotName
in interfaceReplaceTag
- Parameters:
slotName
- a value to the attributeReplaceTag.ATTR_NAME_SLOT_NAME
.
-
replaceSlot
public void replaceSlot(LayoutTag layoutTag)
Replace the slot content which has the same name in the included layout with the content of the replaceTag- Specified by:
replaceSlot
in interfaceReplaceTag
- Parameters:
layoutTag
-
-
getMethodName
public java.lang.String getMethodName()
Description copied from interface:DynamicTag
Returns the method name from which the dynamic contents are generated. The method name is actually the value of the attibuteDynamicTag.ATTR_NAME_METHOD
.- Specified by:
getMethodName
in interfaceDynamicTag
- Returns:
- the method name.
-
setMethodName
public void setMethodName(java.lang.String methodName) throws UnmodifiableException
Description copied from interface:DynamicTag
Sets the method name from which the dynamic contents are generated. The method name is actually the value of the attibuteDynamicTag.ATTR_NAME_METHOD
.- Specified by:
setMethodName
in interfaceDynamicTag
- Parameters:
methodName
- the method name.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
getArguments
public java.util.Enumeration getArguments()
Description copied from interface:DynamicTag
Returns anEnumeration
over all the arguments of the method from which the dynamic contents are generated.- Specified by:
getArguments
in interfaceDynamicTag
- Returns:
- an
Enumeration
over all the arguments.
-
addArgument
public void addArgument(ArgumentTag tag) throws UnmodifiableException
Description copied from interface:DynamicTag
Adds anArgumentTag
as a child of the current tag.- Specified by:
addArgument
in interfaceDynamicTag
- Parameters:
tag
- anArgumentTag
to be added.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
addOnException
public void addOnException(OnExceptionTag tag) throws UnmodifiableException
Description copied from interface:DynamicTag
Adds anOnExceptionTag
as a child of the current tag.- Specified by:
addOnException
in interfaceDynamicTag
- Parameters:
tag
- anOnExceptionTag
to be added.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
getOnExceptions
public java.util.Enumeration getOnExceptions()
Description copied from interface:DynamicTag
Returns anEnumeration
over all the exception tags associated with the method from which the dynamic contents are generated.- Specified by:
getOnExceptions
in interfaceDynamicTag
- Returns:
- an
Enumeration
over all theOnExceptionTag
tags.
-
getMethodSource
public int getMethodSource()
Description copied from interface:DynamicTag
Returns the method source in which the method is defined. Method source can be one of the following- Specified by:
getMethodSource
in interfaceDynamicTag
- Returns:
- the method source.
-
setMethodSource
public void setMethodSource(java.lang.String source) throws UnmodifiableException
Description copied from interface:DynamicTag
Sets the method source in which the method is defined. Method source can be one of the following- Specified by:
setMethodSource
in interfaceDynamicTag
- Parameters:
source
- the method source.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
invokeMethod
public java.lang.Object invokeMethod(MarkupOutput markup, LayoutContext context) throws MalformedMethodException, EmptyListException
Description copied from interface:DynamicTag
Invokes the method to generate the dynamic contents.- Specified by:
invokeMethod
in interfaceDynamicTag
- Parameters:
markup
- aMarkupOutput
object which could be the first parameter of the method if the current tag is aRenderTag
.context
- aLayoutContext
object from which the method source and list values are cached.- Returns:
- the return value of the method call.
- Throws:
MalformedMethodException
- thrown if there is any exception making the method call.EmptyListException
- thrown if theList
cached in theLayoutContext
is empty.
-
addChild
public Tag addChild(Tag tag) throws UnmodifiableException
Description copied from interface:Tag
Adds a child tag.- Specified by:
addChild
in interfaceTag
- Overrides:
addChild
in classTagImpl
- Parameters:
tag
- the child tag to be added.- Returns:
- the child tag just being added.
- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
setAttribute
public void setAttribute(java.lang.String attrName, java.lang.String attrValue) throws UnmodifiableException
Description copied from interface:Tag
Sets a new value to the attribute with the specified attribute name. If the specified attribute does not exist in the current tag, adds it. If the specified attribute value is null, removes the attribute from the current tag.- Specified by:
setAttribute
in interfaceTag
- Overrides:
setAttribute
in classTagImpl
- Parameters:
attrName
- the name of the attributeattrValue
- the value of the attribute- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
getCachedArguments
protected java.util.List getCachedArguments()
-
getExceptions
protected java.util.List getExceptions()
-
getResolvedMethodName
protected java.lang.String getResolvedMethodName()
-
getMethodParameters
protected java.lang.Class[] getMethodParameters() throws TypeUnsupportedException
This method returns the array of method parameter class. The default behavior is to compute from argument tags.- Returns:
- The array of method parameter class.
- Throws:
TypeUnsupportedException
-
getInvocationArguments
protected java.lang.Object[] getInvocationArguments(MarkupOutput markup, LayoutContext context) throws ArgumentUnresolvedException, EmptyListException
-
getInvocationArgumentsFromContext
protected java.lang.Object[] getInvocationArgumentsFromContext(MarkupOutput markup, LayoutContext context) throws ArgumentUnresolvedException, EmptyListException
-
setMethodSourceInternal
protected void setMethodSourceInternal(int source)
-
getMethodParametersFromContext
protected java.lang.Class[] getMethodParametersFromContext(LayoutContext context) throws TypeUnsupportedException
This method returns the method parameters class array from context. Default behavior is to retrieve it from cache.- Parameters:
context
- The layout context.- Returns:
- The array of parameter classes.
- Throws:
TypeUnsupportedException
-
childrenAdded
public void childrenAdded()
- Specified by:
childrenAdded
in interfaceLayoutParserAware
-
-