javax.servlet.jsp.tagext.Tag.setParent()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中javax.servlet.jsp.tagext.Tag.setParent()方法的一些代码示例,展示了Tag.setParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.setParent()方法的具体详情如下:
包路径:javax.servlet.jsp.tagext.Tag
类名称:Tag
方法名:setParent

Tag.setParent介绍

[英]Set the parent (closest enclosing tag handler) of this tag handler. Invoked by the JSP page implementation object prior to doStartTag().

This value is not reset by doEndTag() and must be explicitly reset by a page implementation.
[中]设置此标记处理程序的父级(最近的封闭标记处理程序)。由doStartTag()之前的JSP页面实现对象调用。
此值由doEndTag()重置,必须由页面实现显式重置。

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Test
public void testAssertHasAncestorOfTypeDoesNotThrowExceptionOnPass() throws Exception {
  Tag a = new TagA();
  Tag b = new TagB();
  Tag c = new TagC();
  a.setParent(b);
  b.setParent(c);
  TagUtils.assertHasAncestorOfType(a, TagC.class, "a", "c");
}

代码示例来源:origin: spring-projects/spring-framework

@Test(expected = IllegalStateException.class)
public void assertHasAncestorOfTypeThrowsExceptionOnFail() throws Exception {
      Tag a = new TagA();
      Tag b = new TagB();
      Tag anotherB = new TagB();
      a.setParent(b);
      b.setParent(anotherB);
      TagUtils.assertHasAncestorOfType(a, TagC.class, "a", "c");
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void hasAncestorOfTypeFalseScenario() throws Exception {
  Tag a = new TagA();
  Tag b = new TagB();
  Tag anotherB = new TagB();
  a.setParent(b);
  b.setParent(anotherB);
  assertFalse(TagUtils.hasAncestorOfType(a, TagC.class));
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void hasAncestorOfTypeTrueScenario() throws Exception {
  Tag a = new TagA();
  Tag b = new TagB();
  Tag c = new TagC();
  a.setParent(b);
  b.setParent(c);
  assertTrue(TagUtils.hasAncestorOfType(a, TagC.class));
}

代码示例来源:origin: org.freemarker/freemarker

FreeMarkerPageContext pageContext = PageContextFactory.getCurrentPageContext();
Tag parentTag = (Tag) pageContext.peekTopTag(Tag.class);
tag.setParent(parentTag);
tag.setPageContext(pageContext);
setupTag(tag, args, pageContext.getObjectWrapper());

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

/**
 * Delegates to wrapped tag.
 */
public void setParent(Tag parent)
{
  tag.setParent(parent);
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

/**
 * Delegates to wrapped tag.
 */
public void setParent(Tag parent)
{
  tag.setParent(parent);
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

/**
 * Delegates to wrapped tag.
 */
public void setParent(Tag parent)
{
  tag.setParent(parent);
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

private NestedTag addChild(Object childTag)
{
  if(childTag instanceof Tag)
  {
    ((Tag)childTag).setParent(this.tag);
  }
  /*else if(childTag instanceof SimpleTag)
  {
    ((SimpleTag)childTag).setParent(this.tag);
  }*/
  childs.add(childTag);
  return (NestedTag)childTag;
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

private NestedTag addChild(Object childTag)
{
  if(childTag instanceof Tag)
  {
    ((Tag)childTag).setParent(this.tag);
  }
  /*else if(childTag instanceof SimpleTag)
  {
    ((SimpleTag)childTag).setParent(this.tag);
  }*/
  childs.add(childTag);
  return (NestedTag)childTag;
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

private NestedTag addChild(Object childTag)
{
  if(childTag instanceof Tag)
  {
    ((Tag)childTag).setParent(this.tag);
  }
  /*else if(childTag instanceof SimpleTag)
  {
    ((SimpleTag)childTag).setParent(this.tag);
  }*/
  childs.add(childTag);
  return (NestedTag)childTag;
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

private NestedTag addChild(Object childTag)
{
  if(childTag instanceof Tag)
  {
    ((Tag)childTag).setParent(this.tag);
  }
  /*else if(childTag instanceof SimpleTag)
  {
    ((SimpleTag)childTag).setParent(this.tag);
  }*/
  childs.add(childTag);
  return (NestedTag)childTag;
}

代码示例来源:origin: com.pojosontheweb/ttt-stripes

public TagTemplate(PageContext pageContext, T tag, B parent) {
  this.tag = tag;
  tag.setPageContext(pageContext);
  if (parent != null) {
    tag.setParent(parent);
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

private NestedTag addChild(Object childTag)
{
  if(childTag instanceof Tag)
  {
    ((Tag)childTag).setParent(this.tag);
  }
  else if(childTag instanceof SimpleTag)
  {
    ((SimpleTag)childTag).setParent(this.tag);
  }
  childs.add(childTag);
  return (NestedTag)childTag;
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

private NestedTag addChild(Object childTag)
{
  if(childTag instanceof Tag)
  {
    ((Tag)childTag).setParent(this.tag);
  }
  else if(childTag instanceof SimpleTag)
  {
    ((SimpleTag)childTag).setParent(this.tag);
  }
  childs.add(childTag);
  return (NestedTag)childTag;
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

private NestedTag addChild(Object childTag)
  {
    if(childTag instanceof SimpleTag)
    {
      ((SimpleTag)childTag).setParent(parent);
    }
    else if(parent instanceof Tag)
    {
      if(childTag instanceof Tag)
      {
        ((Tag)childTag).setParent((Tag)parent);
      }
    }
    else if(parent instanceof SimpleTag)
    {
      if(childTag instanceof Tag)
      {
        ((Tag)childTag).setParent(new TagAdapter((SimpleTag)parent));
      }
    }
    childs.add(childTag);
    return (NestedTag)childTag;
  }
}

代码示例来源:origin: com.liferay.faces/liferay-faces-portal

protected void copyAttributes(FacesContext facesContext, U u, T t) {
  copyFrameworkAttributes(facesContext, u, t);
  copyNonFrameworkAttributes(facesContext, u, t);
  t.setParent(getParentTag(facesContext, u, t));
}

代码示例来源:origin: org.seasar.teeda/teeda-extension

protected void setUpTag(final FacesContext context,
    final PageContext pageContext, final Tag tag, final Tag parentTag)
    throws JspException {
  if (parentTag != null) {
    tag.setParent(parentTag);
  }
  tag.setPageContext(pageContext);
  setupProperties(tag);
  composeComponentTreeChildren(context, pageContext, tag);
}

代码示例来源:origin: liferay/liferay-faces

protected void copyAttributes(FacesContext facesContext, U u, T t) {
  copyFrameworkAttributes(facesContext, u, t);
  copyNonFrameworkAttributes(facesContext, u, t);
  t.setParent(getParentTag(facesContext, u, t));
}

代码示例来源:origin: org.seasar.teeda/teeda-extension

protected void process(final PageContext pageContext, final Tag tag,
    final Tag parentTag) throws JspException {
  if (parentTag != null) {
    tag.setParent(parentTag);
  }
  tag.setPageContext(pageContext);
  setupProperties(tag);
  if (tag instanceof BodyTag) {
    processBodyTag(pageContext, (BodyTag) tag);
  } else if (tag instanceof IterationTag) {
    processIterationTag(pageContext, (IterationTag) tag);
  } else {
    processTag(pageContext, tag);
  }
}

相关文章