Java 类javax.servlet.jsp.tagext.TagSupport 实例源码

项目:aem-testing    文件:Tags.java   
@Override
public String renderTag(TagSupport tag, PageContext pageContext, String body) throws Exception {
    StringWriter        strWriter = new StringWriter();
    HttpServletResponse response  = mock(HttpServletResponse.class);
    when(response.getWriter()).thenReturn(new PrintWriter(strWriter, true));

    if (!mockingDetails(pageContext).isSpy()) {
        pageContext = spy(pageContext);
    }

    JspWriter jspWriter = new JspWriterImpl(response);
    doReturn(jspWriter).when(pageContext).getOut();
    tag.setPageContext(pageContext);

    if (Tag.EVAL_BODY_INCLUDE == tag.doStartTag()) {
        jspWriter.flush();
        strWriter.write(body);
    }
    jspWriter.flush();
    tag.doEndTag();
    jspWriter.flush();
    tag.release();
    return strWriter.toString();
}
项目:opengse    文件:TestTag.java   
public void doInitBody() throws JspException {

        //Test for doInitBody method.

        if ( "doInitBody".equalsIgnoreCase ( this.getAtt1() ) ) {
            TestString += this.getAtt1();
        }

        // Test for getParent method in TagSupport

        if ( "getParent".equalsIgnoreCase ( this.getAtt2() ) ) {
            TagSupport ts = new TagSupport();
            setParent( this );
            Tag tt = getParent();
            if ( tt == this ) {
                TestString = TestString + "Pass";
            } else {
                TestString = TestString + "Fails";
            }
        }
    }
项目:Telepathology    文件:AbstractBusinessObjectPropertyTag.java   
@SuppressWarnings("unchecked")
private P getParentTag()
throws JspException
{
    try
       {
        AbstractBusinessObjectTag<T> parentTag = null;
        for(
            parentTag = (AbstractBusinessObjectTag)TagSupport.findAncestorWithClass(this, AbstractBusinessObjectTag.class);
            parentTag != null && ! businessObjectType.equals(parentTag.getBusinessObjectType());
            parentTag = (AbstractBusinessObjectTag)TagSupport.findAncestorWithClass(parentTag, AbstractBusinessObjectTag.class) );

        return (P)parentTag;
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of this '" + this.getClass().getName() + "' must present business object of type '" + getBusinessObjectType().getName() + "'.");
       }
}
项目:nyla    文件:SectionContainerTag.java   
/**
 * 
 * @see javax.servlet.jsp.tagext.TagSupport#doEndTag()
 */
public int doEndTag() throws JspException
{
   try
   {
       section = null;
       pageContext.removeAttribute("counter");
       pageContext.removeAttribute("sectionCounter");
      pageContext.getOut().write("</table>");
      return TagSupport.EVAL_PAGE;
   }
   catch(Exception e)
   {
      throw new JspException(Debugger.stackTrace(e));
   }
}
项目:webcurator    文件:ShowControlTag.java   
@Override
public int doStartTag() throws JspException {  
    StringTokenizer tokenizer = new StringTokenizer(privileges, ";");
    String[] privs = new String[tokenizer.countTokens()];
    for(int i=0; tokenizer.hasMoreTokens(); i++) {
        privs[i] = tokenizer.nextToken();
    }

    if(ownedObject instanceof UserOwnable) {
        showControl = editMode && authorityManager.hasAtLeastOnePrivilege( (UserOwnable) ownedObject, privs);
    }
    else if(ownedObject instanceof AgencyOwnable) {
        showControl = editMode && authorityManager.hasAtLeastOnePrivilege( (AgencyOwnable) ownedObject, privs);
    }
    else {
        showControl = false;
    }
    // release the object (usually its a ti) from the tag to prevent a memory leak (Tags are pooled) 
    ownedObject = null;
    return TagSupport.EVAL_BODY_INCLUDE;
}
项目:webcurator    文件:GrpNameTag.java   
@Override
public int doStartTag() throws JspException {
    try {
        if (name.contains(subGroupSeparator)) {
            int sepIndex = name.lastIndexOf(subGroupSeparator);
            String parentName = name.substring(0, sepIndex);
            String subGroupName = name.substring(sepIndex + subGroupSeparator.length());

            pageContext.getOut().print("<div class=\"subGroupParent\">");
            pageContext.getOut().print(parentName);
            pageContext.getOut().print("</div>");

            pageContext.getOut().print(subGroupSeparator);
            pageContext.getOut().print("<div class=\"subGroupChild\">");
            pageContext.getOut().print(subGroupName);
            pageContext.getOut().print("</div>");
        } else {
            pageContext.getOut().print(name);
        }
    } catch (IOException ex) {
        throw new JspException(ex);
    }

    return TagSupport.SKIP_BODY;
}
项目:webcurator    文件:TreeTag.java   
@SuppressWarnings("unchecked")
public int doStartTag() throws JspException {
           rowAlt = 0;
    try {

        //NodeTree theTree = (NodeTree) ExpressionUtil.evalNotNull("tree", "tree", tree, NodeTree.class, this, pageContext);
        NodeTree theTree = getTree();
        Iterator<Node> rootIterator = theTree.getRootNodes().iterator();

        pageContext.getOut().println("<table cellspacing=\"0\" cellpadding=\"0\">");

        displayHeader(pageContext.getOut());

        while (rootIterator.hasNext()) {
            display(pageContext.getOut(), rootIterator.next(), 0);
        }
        pageContext.getOut().println("</table>");
    } 
    catch (IOException ex) {
        throw new JspException(ex.getMessage(), ex);
    }

    // Never process the body.
    return TagSupport.SKIP_BODY;
}
项目:rave    文件:RenderInitializationScriptTagTest.java   
@Test
public void doStartTag_beforeRave_existingAttribute() throws Exception {
    tag.setLocation(ScriptLocation.BEFORE_RAVE);

    expect(pageContext.getRequest()).andReturn(request);
    expect(request.getAttribute(ModelKeys.BEFORE_RAVE_INIT_SCRIPT)).andReturn(VALID_SCRIPT);
    expect(pageContext.getOut()).andReturn(writer);
    writer.print(VALID_SCRIPT.toString());
    expectLastCall();
    replay(pageContext, request, writer);

    int returnValue = tag.doStartTag();
    assertThat(returnValue, is(TagSupport.EVAL_BODY_INCLUDE));

    verify(pageContext, request, writer);
}
项目:rave    文件:RenderInitializationScriptTagTest.java   
@Test
public void doStartTag_afterRave_existingAttribute() throws Exception {
    tag.setLocation(ScriptLocation.AFTER_RAVE);

    expect(pageContext.getRequest()).andReturn(request);
    expect(request.getAttribute(ModelKeys.AFTER_RAVE_INIT_SCRIPT)).andReturn(VALID_SCRIPT);
    expect(pageContext.getOut()).andReturn(writer);
    writer.print(VALID_SCRIPT.toString());
    expectLastCall();
    replay(pageContext, request, writer);

    int returnValue = tag.doStartTag();
    assertThat(returnValue, is(TagSupport.EVAL_BODY_INCLUDE));

    verify(pageContext, request, writer);
}
项目:rave    文件:ScriptTagTest.java   
@Test
public void doStartTag_skip() throws IOException, JspException {

    List<String> strings = new ArrayList<String>();
    strings.add(SCRIPT);
    strings.add(SCRIPT_2);
    expect(service.getScriptBlocks(ScriptLocation.BEFORE_RAVE, context)).andReturn(null);
    replay(service);

    JspWriter writer = createNiceMock(JspWriter.class);
    replay(writer);

    expect(pageContext.getOut()).andReturn(writer).anyTimes();
    replay(pageContext);

    tag.setLocation(ScriptLocation.BEFORE_RAVE);
    int result = tag.doStartTag();
    assertThat(result, is(equalTo(TagSupport.SKIP_BODY)));
    verify(writer);
}
项目:winlet    文件:DialogButtonTag.java   
public int doAfterBody() {
    try {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        OutputStreamWriter writer = new OutputStreamWriter(baos, "UTF-8");
        bodyContent.writeOut(writer);
        writer.flush();
        button.put("label", baos.toString("UTF-8"));
    } catch (IOException e) {
        e.printStackTrace();
    }

    DialogTag dialog = (DialogTag) TagSupport.findAncestorWithClass(this,
            DialogTag.class);
    dialog.addButton(button);
    button = new HashMap<String, String>();
    bodyContent.clearBody();

    return SKIP_BODY;
}
项目:webgenome    文件:OnlyIfClientModeTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    int rVal = TagSupport.SKIP_BODY;
    try {
        SessionMode mode =
            org.rti.webgenome.webui.util.PageContext.getSessionMode(
                (HttpServletRequest) pageContext.getRequest());
        if (mode == SessionMode.CLIENT) {
            rVal = TagSupport.EVAL_BODY_INCLUDE;
        }
    } catch (SessionTimeoutException e) {
        rVal = TagSupport.SKIP_BODY;
    }
    return rVal;
}
项目:webgenome    文件:QuantitationTypeOptionsTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    Map<String, QuantitationType> index =
        QuantitationType.getQuantitationTypeIndex();
    Writer out = pageContext.getOut();
    for (String id : index.keySet()) {
        String name = index.get(id).getName();
        try {
            out.write("<option value=\"" + id + "\">" + name + "</option>");
        } catch (IOException e) {
            throw new JspException("Error writing to page.");
        }
    }
    return TagSupport.SKIP_BODY;
}
项目:webgenome    文件:OnlyIfParameteredDerivedExperimentTag.java   
/**
 * {@inheritDoc}
 */
@Override
public int doStartTag() throws JspException {
    int rval = TagSupport.SKIP_BODY;
    if (name != null && name.length() > 0) {
        Object obj = pageContext.findAttribute(name);
        if (obj != null) {
            if (!(obj instanceof Experiment)) {
                throw new JspException("Bean named '"
                        + this.name + "' not of type Experiment");
            }
            Experiment exp = (Experiment) obj;
            if (exp.isDerived()) {
                AnalysisDataSourceProperties props =
                    (AnalysisDataSourceProperties)
                    exp.getDataSourceProperties();
                Collection<UserConfigurableProperty> userProps =
                    props.getUserConfigurableProperties();
                if (userProps != null && userProps.size() > 0) {
                    rval = TagSupport.EVAL_BODY_INCLUDE;
                }
            }
        }
    }
    return rval;
}
项目:webgenome    文件:OnlyIfAdminTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    int rVal = TagSupport.SKIP_BODY;
    try {
        Principal principal =
            org.rti.webgenome.webui.util.PageContext.getPrincipal(
                (HttpServletRequest) pageContext.getRequest());
        if (principal.isAdmin()) {
            rVal = TagSupport.EVAL_BODY_INCLUDE;
        }
    } catch (SessionTimeoutException e) {
        rVal = TagSupport.SKIP_BODY;
    }
    return rVal;
}
项目:webgenome    文件:OnlyIfLoggedInAndStandAloneModeTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    int rVal = TagSupport.SKIP_BODY;
    try {
        SessionMode mode =
            org.rti.webgenome.webui.util.PageContext.getSessionMode(
                (HttpServletRequest) pageContext.getRequest());
        Principal principal =
            org.rti.webgenome.webui.util.PageContext.getPrincipal(
                    (HttpServletRequest) pageContext.getRequest());
        if (mode == SessionMode.STAND_ALONE && principal != null) {
            rVal = TagSupport.EVAL_BODY_INCLUDE;
        }
    } catch (SessionTimeoutException e) {
        rVal = TagSupport.SKIP_BODY;
    }
    return rVal;
}
项目:webgenome    文件:OnlyIfClientModeTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    int rVal = TagSupport.SKIP_BODY;
    try {
        SessionMode mode =
            org.rti.webgenome.webui.util.PageContext.getSessionMode(
                (HttpServletRequest) pageContext.getRequest());
        if (mode == SessionMode.CLIENT) {
            rVal = TagSupport.EVAL_BODY_INCLUDE;
        }
    } catch (SessionTimeoutException e) {
        rVal = TagSupport.SKIP_BODY;
    }
    return rVal;
}
项目:webgenome    文件:QuantitationTypeOptionsTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    Map<String, QuantitationType> index =
        QuantitationType.getQuantitationTypeIndex();
    Writer out = pageContext.getOut();
    for (String id : index.keySet()) {
        String name = index.get(id).getName();
        try {
            out.write("<option value=\"" + id + "\">" + name + "</option>");
        } catch (IOException e) {
            throw new JspException("Error writing to page.");
        }
    }
    return TagSupport.SKIP_BODY;
}
项目:webgenome    文件:OnlyIfParameteredDerivedExperimentTag.java   
/**
 * {@inheritDoc}
 */
@Override
public int doStartTag() throws JspException {
    int rval = TagSupport.SKIP_BODY;
    if (name != null && name.length() > 0) {
        Object obj = pageContext.findAttribute(name);
        if (obj != null) {
            if (!(obj instanceof Experiment)) {
                throw new JspException("Bean named '"
                        + this.name + "' not of type Experiment");
            }
            Experiment exp = (Experiment) obj;
            if (exp.isDerived()) {
                AnalysisDataSourceProperties props =
                    (AnalysisDataSourceProperties)
                    exp.getDataSourceProperties();
                Collection<UserConfigurableProperty> userProps =
                    props.getUserConfigurableProperties();
                if (userProps != null && userProps.size() > 0) {
                    rval = TagSupport.EVAL_BODY_INCLUDE;
                }
            }
        }
    }
    return rval;
}
项目:webgenome    文件:OnlyIfAdminTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    int rVal = TagSupport.SKIP_BODY;
    try {
        Principal principal =
            org.rti.webgenome.webui.util.PageContext.getPrincipal(
                (HttpServletRequest) pageContext.getRequest());
        if (principal.isAdmin()) {
            rVal = TagSupport.EVAL_BODY_INCLUDE;
        }
    } catch (SessionTimeoutException e) {
        rVal = TagSupport.SKIP_BODY;
    }
    return rVal;
}
项目:webgenome    文件:OnlyIfLoggedInAndStandAloneModeTag.java   
/**
 * Do after start tag parsed.
 * @throws JspException if anything goes wrong.
 * @return Return value
 */
@Override
public final int doStartTag() throws JspException {
    int rVal = TagSupport.SKIP_BODY;
    try {
        SessionMode mode =
            org.rti.webgenome.webui.util.PageContext.getSessionMode(
                (HttpServletRequest) pageContext.getRequest());
        Principal principal =
            org.rti.webgenome.webui.util.PageContext.getPrincipal(
                    (HttpServletRequest) pageContext.getRequest());
        if (mode == SessionMode.STAND_ALONE && principal != null) {
            rVal = TagSupport.EVAL_BODY_INCLUDE;
        }
    } catch (SessionTimeoutException e) {
        rVal = TagSupport.SKIP_BODY;
    }
    return rVal;
}
项目:myfaces-trinidad    文件:UIXComponentTag.java   
@Override
public int doStartTag() throws JspException
{
  _parentELContext = (ELContextTag)
     TagSupport.findAncestorWithClass(this, ELContextTag.class);

  // Transform "rendered" on behalf of the UIComponentTag
  String rendered = _rendered;
  if (rendered != null)
  {
    if ((_parentELContext != null) && isValueReference(rendered))
      rendered = _parentELContext.transformExpression(rendered);

    super.setRendered(rendered);
  }


  String id = _id;
  if (id != null)
  {
    if (_parentELContext != null)
      id = _parentELContext.transformId(id);

    super.setId(id);
  }

  int retVal = super.doStartTag();

  //pu: There could have been some validation error during property setting
  //  on the bean, this is the closest opportunity to burst out.
  if (_validationError != null)
    throw new JspException(_validationError);

  return retVal;
}
项目:spring4-understanding    文件:TransformTag.java   
@Override
protected final int doStartTagInternal() throws JspException {
    if (this.value != null) {
        // Find the containing EditorAwareTag (e.g. BindTag), if applicable.
        EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class);
        if (tag == null) {
            throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
        }

        // OK, let's obtain the editor...
        String result = null;
        PropertyEditor editor = tag.getEditor();
        if (editor != null) {
            // If an editor was found, edit the value.
            editor.setValue(this.value);
            result = editor.getAsText();
        }
        else {
            // Else, just do a toString.
            result = this.value.toString();
        }
        result = htmlEscape(result);
        if (this.var != null) {
            pageContext.setAttribute(this.var, result, TagUtils.getScope(this.scope));
        }
        else {
            try {
                // Else, just print it out.
                pageContext.getOut().print(result);
            }
            catch (IOException ex) {
                throw new JspException(ex);
            }
        }
    }

    return SKIP_BODY;
}
项目:spring-abc    文件:Flashback.java   
@Override
public int doStartTag() throws JspException {
    JspWriter out = this.pageContext.getOut();
    try {
        out.print(FlashbackSupport.format(time));
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return TagSupport.SKIP_BODY;
}
项目:rabbitframework    文件:NotAuthenticatedTag.java   
public int onDoStartTag() throws JspException {
    if (getSubject() == null || !getSubject().isAuthenticated()) {
        if (log.isTraceEnabled()) {
            log.trace("Subject does not exist or is not authenticated.  Tag body will be evaluated.");
        }
        return TagSupport.EVAL_BODY_INCLUDE;
    } else {
        if (log.isTraceEnabled()) {
            log.trace("Subject exists and is authenticated.  Tag body will not be evaluated.");
        }
        return TagSupport.SKIP_BODY;
    }
}
项目:rabbitframework    文件:GuestTag.java   
public int onDoStartTag() throws JspException {
    if (getSubject() == null || getSubject().getPrincipal() == null) {
        if (log.isTraceEnabled()) {
            log.trace("Subject does not exist or does not have a known identity (aka 'principal').  " +
                    "Tag body will be evaluated.");
        }
        return TagSupport.EVAL_BODY_INCLUDE;
    } else {
        if (log.isTraceEnabled()) {
            log.trace("Subject exists or has a known identity (aka 'principal').  " +
                    "Tag body will not be evaluated.");
        }
        return TagSupport.SKIP_BODY;
    }
}
项目:rabbitframework    文件:AuthenticatedTag.java   
public int onDoStartTag() throws JspException {
    if (getSubject() != null && getSubject().isAuthenticated()) {
        if (log.isTraceEnabled()) {
            log.trace("Subject exists and is authenticated.  Tag body will be evaluated.");
        }
        return TagSupport.EVAL_BODY_INCLUDE;
    } else {
        if (log.isTraceEnabled()) {
            log.trace("Subject does not exist or is not authenticated.  Tag body will not be evaluated.");
        }
        return TagSupport.SKIP_BODY;
    }
}
项目:rabbitframework    文件:RoleTag.java   
public int onDoStartTag() throws JspException {
    boolean show = showTagBody(getName());
    if (show) {
        return TagSupport.EVAL_BODY_INCLUDE;
    } else {
        return TagSupport.SKIP_BODY;
    }
}
项目:rabbitframework    文件:PermissionTag.java   
public int onDoStartTag() throws JspException {

        String p = getName();

        boolean show = showTagBody(p);
        if (show) {
            return TagSupport.EVAL_BODY_INCLUDE;
        } else {
            return TagSupport.SKIP_BODY;
        }
    }
项目:personal    文件:IterateTag.java   
@Override
public int doStartTag() throws JspException {
    Object object = this.pageContext.getAttribute(items);

    if (object != null && object instanceof List) {
        this.iterator = ((List) object).iterator();

        if (iterator.hasNext()) {
            this.pageContext.setAttribute(value, iterator.next());
            return TagSupport.EVAL_BODY_INCLUDE; // 执行标签体
        }
    }

    return SKIP_BODY;
}
项目:personal    文件:HelloTag.java   
@Override
public int doStartTag() throws JspException {
    JspWriter jspWriter = this.pageContext.getOut();
    try {
        jspWriter.println("自定义标签"+ name + "你好");
    } catch (IOException e) {
        e.printStackTrace();
    }

    return TagSupport.SKIP_BODY; // 跳过body, 直接结束标签
}
项目:openmrs-module-legacyui    文件:OpenmrsMessageTagTest.java   
private void checkDoEndTagEvaluationOfVar(String varName, int scope, String expectedOutput) throws Exception {
    final int tagReturnValue = openmrsMessageTag.doEndTag();
    final String output = (String) mockPageContext.getAttribute(varName, scope);

    Assert.assertEquals("Tag should return 'EVAL_PAGE'", TagSupport.EVAL_PAGE, tagReturnValue);
    Assert.assertEquals(String.format("Variable '%s' should be '%s'", varName, expectedOutput), output, expectedOutput);
}
项目:openmrs-module-legacyui    文件:OpenmrsMessageTagTest.java   
/**
 * Convenient method that checks results of evaluation of {@link OpenmrsMessageTag#doEndTag()}
 * method
 * 
 * @param expectedOutput the expected output of tag evaluation
 * @throws Exception if any evaluation error occurs
 */
private void checkDoEndTagEvaluation(String expectedOutput) throws Exception {
    int tagReturnValue = openmrsMessageTag.doEndTag();
    String output = ((MockHttpServletResponse) mockPageContext.getResponse()).getContentAsString();

    Assert.assertEquals("Tag should return 'EVAL_PAGE'", TagSupport.EVAL_PAGE, tagReturnValue);
    Assert.assertEquals(String.format("Output should be '%s'", expectedOutput), expectedOutput, output);
}
项目:Telepathology    文件:AbstractEnumIteratorElementTag.java   
/**
 * 
 * @return
 * @throws JspException
 */
protected EnumIteratorTag getParentEnumIteratorTag()
throws JspException
{
    try
       {
        return (EnumIteratorTag)TagSupport.findAncestorWithClass(this, EnumIteratorTag.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of any derivation of AbstractEnumIteratorElementTag must be of type EnumIteratorTag");
       }
}
项目:Telepathology    文件:WellKnownOIDElementSelectedTag.java   
/**
 * 
 * @return
 * @throws JspException
 */
protected WellKnownOIDIteratorTag getParentEnumIteratorTag()
throws JspException
{
    try
       {
        return (WellKnownOIDIteratorTag)TagSupport.findAncestorWithClass(this, WellKnownOIDIteratorTag.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of any derivation of AbstractEnumIteratorElementTag must be of type EnumIteratorTag");
       }
}
项目:Telepathology    文件:PatientListElementTag.java   
private AbstractPatientListTag getParentListTag()
throws JspException
{
    try
       {
        return (AbstractPatientListTag)TagSupport.findAncestorWithClass(this, AbstractPatientListTag.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of StudyListElementTag must be of type AbstractStudyListTag");
       }
}
项目:Telepathology    文件:AbstractPatientPropertyTag.java   
private AbstractPatientTag getParentPatientTag()
throws JspException
{
    try
       {
        return (AbstractPatientTag)TagSupport.findAncestorWithClass(this, AbstractPatientTag.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of AbstractStudyPropertyTag must be of type AbstractStudyTag");
       }
}
项目:Telepathology    文件:AbstractWellKnownOIDElementTag.java   
/**
 * 
 * @return
 * @throws JspException
 */
protected WellKnownOIDIteratorTag getParentEnumIteratorTag()
throws JspException
{
    try
       {
        return (WellKnownOIDIteratorTag)TagSupport.findAncestorWithClass(this, WellKnownOIDIteratorTag.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of any derivation of AbstractEnumIteratorElementTag must be of type EnumIteratorTag");
       }
}
项目:Telepathology    文件:StringArrayListElement.java   
private StringArrayList getParentTag()
throws JspException
{
    try
       {
        return (StringArrayList)TagSupport.findAncestorWithClass(this, StringArrayList.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of ObjectOriginListElement must be of type StringArrayList");
       }
}
项目:Telepathology    文件:AbstractSeriesPropertyTag.java   
private AbstractSeriesTag getParentSeriesTag()
throws JspException
{
    try
       {
        return (AbstractSeriesTag)TagSupport.findAncestorWithClass(this, AbstractSeriesTag.class);
       } 
    catch (ClassCastException e)
       {
        throw new JspException("Parent tag of AbstractSeriesPropertyTag must be of type AbstractSeriesTag");
       }
}