Examples of ToolInfo


Examples of org.apache.velocity.tools.ToolInfo

        return this.restrictTo;
    }

    public ToolInfo createInfo()
    {
        ToolInfo info = null;
        Status status = getStatus();
        switch (status)
        {
            case VALID:
                info = new ToolInfo(getKey(), getToolClass());
                break;
            case OLD:
                info = new OldToolInfo(getKey(), getToolClass());
                break;
            default:
                throw new ConfigurationException(this, getError(status));
        }

        info.restrictTo(getRestrictTo());
        // it's ok to use this here, because we know it's the
        // first time properties have been added to this ToolInfo
        info.addProperties(getProperties());
        return info;
    }
View Full Code Here

Examples of org.apache.velocity.tools.ToolInfo

        return this.restrictTo;
    }

    public ToolInfo createInfo()
    {
        ToolInfo info = null;
        Status status = getStatus();
        switch (status)
        {
            case VALID:
                info = new ToolInfo(getKey(), getToolClass());
                break;
            case OLD:
                info = new OldToolInfo(getKey(), getToolClass());
                break;
            default:
                throw new ConfigurationException(this, getError(status));
        }

        info.restrictTo(getRestrictTo());
        // it's ok to use this here, because we know it's the
        // first time properties have been added to this ToolInfo
        info.addProperties(getPropertyMap());
        return info;
    }
View Full Code Here

Examples of org.apache.velocity.tools.ToolInfo

        return this.restrictTo;
    }

    public ToolInfo createInfo()
    {
        ToolInfo info = null;
        Status status = getStatus();
        switch (status)
        {
            case VALID:
                info = new ToolInfo(getKey(), getToolClass());
                break;
            case OLD:
                info = new OldToolInfo(getKey(), getToolClass());
                break;
            default:
                throw new ConfigurationException(this, getError(status));
        }

        info.restrictTo(getRestrictTo());
        // it's ok to use this here, because we know it's the
        // first time properties have been added to this ToolInfo
        info.addProperties(getPropertyMap());
        return info;
    }
View Full Code Here

Examples of org.apache.velocity.tools.ToolInfo

        return this.skipSetters;
    }

    public ToolInfo createInfo()
    {
        ToolInfo info = null;
        Status status = getStatus();
        switch (status)
        {
            case VALID:
                info = new ToolInfo(getKey(), getToolClass());
                break;
            case OLD:
                info = new OldToolInfo(getKey(), getToolClass());
                break;
            default:
                throw new ConfigurationException(this, getError(status));
        }

        info.restrictTo(getRestrictTo());
        if (getSkipSetters() != null)
        {
            info.setSkipSetters(getSkipSetters());
        }
        // it's ok to use this here, because we know it's the
        // first time properties have been added to this ToolInfo
        info.addProperties(getPropertyMap());
        return info;
    }
View Full Code Here

Examples of org.apache.velocity.tools.view.ToolInfo

        //add and initialize request tools
        Iterator i = requestToolInfo.iterator();
        while(i.hasNext())
        {
            ToolInfo info = (ToolInfo)i.next();
            if (info instanceof ServletToolInfo)
            {
                ServletToolInfo sti = (ServletToolInfo)info;
                if (!sti.allowsRequestPath(requestPath))
                {
                    continue;
                }
            }
            toolbox.put(info.getKey(), info.getInstance(ctx));
        }

        return toolbox;
    }
View Full Code Here

Examples of org.apache.velocity.tools.view.ToolInfo

        //add and initialize request tools
        Iterator i = requestToolInfo.iterator();
        while(i.hasNext())
        {
            ToolInfo info = (ToolInfo)i.next();
            if (info instanceof ServletToolInfo)
            {
                ServletToolInfo sti = (ServletToolInfo)info;
                if (!sti.allowsRequestPath(requestPath))
                {
                    continue;
                }
            }
            toolbox.put(info.getKey(), info.getInstance(ctx));
        }

        return toolbox;
    }
View Full Code Here

Examples of org.apache.velocity.tools.view.ToolInfo

     */
    protected boolean readElement(Element e) throws Exception
    {
        String name = e.getName();

        ToolInfo info = null;

        if (name.equalsIgnoreCase(ELEMENT_TOOL))
        {
            info = readToolInfo(e);
        }
        else if (name.equalsIgnoreCase(ELEMENT_DATA))
        {
            info = readDataInfo(e);
        }
        else if (name.equalsIgnoreCase(ELEMENT_CREATE_SESSION))
        {
            readCreateSession(e);
            return true;
        }
        else
        {
            log("Unreadable element: "+name);
            return false;
        }

        addTool(info);
        log("Added "+info.getClassname()+" as "+info.getKey());
        return true;
    }
View Full Code Here

Examples of org.apache.velocity.tools.view.ToolInfo

                    {
                        stmap = new HashMap(sessionToolInfo.size());
                        Iterator i = sessionToolInfo.iterator();
                        while(i.hasNext())
                        {
                            ToolInfo info = (ToolInfo)i.next();
                            stmap.put(info.getKey(), info.getInstance(ctx));
                        }
                        session.setAttribute(SESSION_TOOLS_KEY, stmap);
                    }

                    //add the initialized session tools to the toolbox
                    toolbox.putAll(stmap);
                }
            }
        }

        //add and initialize request tools
        Iterator i = requestToolInfo.iterator();
        while(i.hasNext())
        {
            ToolInfo info = (ToolInfo)i.next();
            toolbox.put(info.getKey(), info.getInstance(ctx));
        }

        return new ToolboxContext(toolbox);
    }
View Full Code Here

Examples of org.apache.velocity.tools.view.ToolInfo

        //add and initialize request tools
        Iterator i = requestToolInfo.iterator();
        while(i.hasNext())
        {
            ToolInfo info = (ToolInfo)i.next();
            if (info instanceof ServletToolInfo)
            {
                ServletToolInfo sti = (ServletToolInfo)info;
                if (!sti.allowsRequestPath(requestPath))
                {
                    continue;
                }
            }
            toolbox.put(info.getKey(), info.getInstance(ctx));
        }

        return toolbox;
    }
View Full Code Here

Examples of org.apache.velocity.tools.view.ToolInfo

        //add and initialize request tools
        Iterator i = requestToolInfo.iterator();
        while(i.hasNext())
        {
            ToolInfo info = (ToolInfo)i.next();
            if (info instanceof ServletToolInfo)
            {
                ServletToolInfo sti = (ServletToolInfo)info;
                if (!sti.allowsRequestPath(requestPath))
                {
                    continue;
                }
            }
            toolbox.put(info.getKey(), info.getInstance(ctx));
        }

        return toolbox;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.