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

项目:lazycat    文件:Node.java   
public CustomTag(String qName, String prefix, String localName, String uri, Attributes attrs,
        Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent, TagInfo tagInfo,
        Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class.isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class.isAssignableFrom(tagHandlerClass);
}
项目:TechnologyReadinessTool    文件:EvaluateTagHelper.java   
@Override
public String execute() throws Exception {
    if (tag != null) {
        try {
            getValueStack().push(tag);
            for (Entry<String, Object> dynamicAttribute : getDynamicAttributes().entrySet()) {
                getValueStack().setValue(dynamicAttribute.getKey(), dynamicAttribute.getValue());
            }
        } finally {
            getValueStack().pop();
        }
    }
    if (tagBody == null) {
        tagBody = getJspBody();
    }
    if (tag instanceof SimpleTag) {
        processTag((SimpleTag) tag);
    } else if (tag instanceof Tag) {
        processTag((Tag) tag);
    }
    return null;
}
项目:tomcat7    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:lams    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:apache-tomcat-7.0.73-with-comment    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:packagedrone    文件:Node.java   
public CustomTag(String jspVersion, String qName, String prefix,
                        String localName,
         String uri, Attributes attrs,
         Attributes nonTaglibXmlnsAttrs,
         Attributes taglibAttrs,
         Mark start, Node parent, TagInfo tagInfo,
         Class tagHandlerClass) {
           super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
                 start, parent);

           this.jspVersion = Double.valueOf(jspVersion).doubleValue();
    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
           this.childInfo = new ChildInfo();

    this.implementsIterationTag = 
    IterationTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag =
    BodyTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = 
    TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = 
    SimpleTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = 
    DynamicAttributes.class.isAssignableFrom(tagHandlerClass);
}
项目:class-guard    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:package-drone    文件:Node.java   
public CustomTag(String jspVersion, String qName, String prefix,
                        String localName,
         String uri, Attributes attrs,
         Attributes nonTaglibXmlnsAttrs,
         Attributes taglibAttrs,
         Mark start, Node parent, TagInfo tagInfo,
         Class tagHandlerClass) {
           super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
                 start, parent);

           this.jspVersion = Double.valueOf(jspVersion).doubleValue();
    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
           this.childInfo = new ChildInfo();

    this.implementsIterationTag = 
    IterationTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag =
    BodyTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = 
    TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = 
    SimpleTag.class.isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = 
    DynamicAttributes.class.isAssignableFrom(tagHandlerClass);
}
项目:apache-tomcat-7.0.57    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:apache-tomcat-7.0.57    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:WBSAirback    文件:Node.java   
public CustomTag(String qName, String prefix, String localName,
        String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs,
        Attributes taglibAttrs, Mark start, Node parent,
        TagInfo tagInfo, Class<?> tagHandlerClass) {
    super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
            start, parent);

    this.uri = uri;
    this.prefix = prefix;
    this.tagInfo = tagInfo;
    this.tagHandlerClass = tagHandlerClass;
    this.customNestingLevel = makeCustomNestingLevel();
    this.childInfo = new ChildInfo();

    this.implementsIterationTag = IterationTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsBodyTag = BodyTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsTryCatchFinally = TryCatchFinally.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsSimpleTag = SimpleTag.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsDynamicAttributes = DynamicAttributes.class
            .isAssignableFrom(tagHandlerClass);
    this.implementsJspIdConsumer = JspIdConsumer.class
            .isAssignableFrom(tagHandlerClass);
}
项目:jaj_taglib    文件:BuilderTagBase_BoundaryCasesTest.java   
/**
 * Tests that event tag's parents are scanned deeply to find a BuilderTagBase parent.
 */
public void testBuildGrid_EventsWithIndirectBuilderParentTag() throws Exception
{
    final EventTag rowStartTag = initEvent("rowStart", '^');
    final EventTag rowEndTag = initEvent("rowEnd", '$');

    final SimpleTag cellTagParent = new SimpleTagSupport()
    {
        @Override
        public void doTag() throws IOException, JspException
        {
            getJspBody().invoke(getJspContext().getOut());
        }
    };
    cellTagParent.setJspContext(ctx);
    cellTagParent.setParent(gridTag);
    final EventTag cellTag = initEvent(cellTagParent, "cell", '-');
    cellTagParent.setJspBody(new CallTagsJspFragment(cellTag));

    final CallTagsJspFragment body = new CallTagsJspFragment("foo", rowStartTag, rowEndTag, cellTagParent);
    gridTag.setJspBody(body);

    gridTag.rowCount = 3;
    gridTag.columnCount = 2;

    gridTag.doTag();

    assertTrue(gridTag.buildInvoked);
    assertTrue(body.invoked);
    assertEquals("^--$^--$^--$", out.getOutput());
}
项目:jaj_taglib    文件:CallTagsJspFragment.java   
@Override
public void invoke(final Writer out) throws JspException, IOException
{
    Assert.assertFalse(invoked);
    invoked = true;
    out.write(textToWrite);
    for (final SimpleTag tag : tags) {
        tag.doTag();
    }
}
项目:mayaa    文件:JspProcessor.java   
public TagPool(Class clazz) {
    if (isSupportClass(clazz) == false) {
        throw new IllegalArgumentException();
    }
    _clazz = clazz;
    _isSimpleTag = SimpleTag.class.isAssignableFrom(_clazz);
}
项目:mayaa    文件:JspProcessor.java   
public Tag borrowTag() {
    if (_isSimpleTag) {
        // SimpleTagはプールしない
        return new SimpleTagWrapper((SimpleTag) ObjectUtil.newInstance(_clazz));
    }
    return (Tag) borrowObject();
}
项目:mayaa    文件:JspProcessor.java   
public Tag getParent() {
    if (!_parentDetermined) {
        JspTag simpleTagParent = _simpleTag.getParent();
        if (simpleTagParent != null) {
            if (simpleTagParent instanceof Tag) {
                _parent = (Tag) simpleTagParent;
            } else {
                _parent = new SimpleTagWrapper((SimpleTag) simpleTagParent);
            }
        }
        _parentDetermined = true;
    }

    return _parent;
}
项目:TechnologyReadinessTool    文件:EvaluateTagHelper.java   
void processTag(SimpleTag tag) throws JspException, IOException {
    tag.setJspContext(getJspContext());
    tag.doTag();
}
项目:jaj_taglib    文件:CallTagsJspFragment.java   
public CallTagsJspFragment(final SimpleTag... tags)
{
    this("", tags);
}
项目:jaj_taglib    文件:CallTagsJspFragment.java   
public CallTagsJspFragment(final String textToWrite, final SimpleTag... tags)
{
    Assert.assertNotNull(tags);
    this.tags = tags;
    this.textToWrite = textToWrite;
}
项目:mayaa    文件:JspProcessor.java   
public static boolean isSupportClass(Class test) {
    return test != null &&
            (Tag.class.isAssignableFrom(test)
            || SimpleTag.class.isAssignableFrom(test));
}
项目:mayaa    文件:JspProcessor.java   
public ProcessStatus doStartProcess(Page topLevelPage) {
    if (_tagClass == null) {
        throw new IllegalStateException();
    }
    topLevelPage.registBeginRenderNotifier(this);
    clearLoadedTag();
    Tag customTag = getLoadedTag();

    // javax.servlet.jsp.tagext.SimpleTag対応
    Object targetTag = customTag;
    if (customTag instanceof SimpleTagWrapper) {
        SimpleTagWrapper simpleTagWrapper = (SimpleTagWrapper) customTag;
        SimpleTag simpleTag = simpleTagWrapper.getSimpleTag();
        int childProcessorSize = getChildProcessorSize();
        if (childProcessorSize > 0) {
            simpleTag.setJspBody(
                    new ProcessorFragment(simpleTagWrapper, this, topLevelPage));
        }
        targetTag = simpleTag;
    }
    for (Iterator it = iterateProperties(); it.hasNext();) {
        ProcessorProperty property = (ProcessorProperty) it.next();
        ObjectUtil.setProperty(targetTag,
                property.getName().getQName().getLocalName(),
                property.getValue().execute(null));
    }

    // javax.servlet.jsp.tagext.DynamicAttributes対応
    if (TLDProcessorDefinition.class.isAssignableFrom(
            getProcessorDefinition().getClass())) {
        TLDProcessorDefinition tldDef =
            (TLDProcessorDefinition) getProcessorDefinition();
        if (tldDef.isDynamicAttribute()) {
            setupDynamicAttributes(customTag);
        }
    }

    ProcessorTreeWalker processor = this;
    while ((processor = processor.getParentProcessor()) != null) {
        if (processor instanceof JspProcessor) {
            JspProcessor jspProcessor = (JspProcessor) processor;
            Tag parentTag = jspProcessor.getLoadedTag();
            if (parentTag == null) {
                throw new IllegalStateException(
                        "the parent processor has no custom tag.");
            }
            customTag.setParent(parentTag);
            break;
        }
    }
    try {
        pushNestedVariables();
        return getProcessStatus(customTag.doStartTag(), true);
    } catch (JspException e) {
        throw createJspRuntimeException(
                getOriginalNode(), getInjectedNode(), e);
    }
}
项目:mayaa    文件:JspProcessor.java   
protected Object createObject() {
    if (Tag.class.isAssignableFrom(_clazz)) {
        return ObjectUtil.newInstance(_clazz);
    }
    return new SimpleTagWrapper((SimpleTag) ObjectUtil.newInstance(_clazz));
}
项目:mayaa    文件:JspProcessor.java   
public SimpleTagWrapper(SimpleTag simpleTag) {
    if (simpleTag == null) {
        throw new IllegalArgumentException("simpleTag is null");
    }
    this._simpleTag = simpleTag;
}
项目:mayaa    文件:JspProcessor.java   
public SimpleTag getSimpleTag() {
    return _simpleTag;
}