Package org.apache.commons.jelly.impl

Examples of org.apache.commons.jelly.impl.TagFactory


        throws JellyException
    {

        if ( name.equals( "tagdef" ) )
        {
            return new TagScript( new TagFactory()
            {
                public Tag createTag( String name, Attributes attributes )
                {
                    return new TagDefTag( JeezTagLibrary.this );
                }
            } );
        }
        if ( name.equals( "target" ) )
        {
            return new TagScript( new TagFactory()
            {
                public Tag createTag( String name, Attributes attributes )
                {
                    return new TargetTag();
                }
            } );
        }

        TagScript script = werkzTagLib.createTagScript( name, attrs );
        if ( script == null )
        {
            script = antTagLib.createCustomTagScript( name, attrs );
            if ( script == null )
            {
                return new TagScript( new TagFactory()
                {
                    public Tag createTag( String name, Attributes attributes )
                        throws JellyException
                    {
                        // lets try create a dynamic tag first
View Full Code Here


        TagScript answer = super.createTagScript(name, attributes);
        if ( answer == null ) {
            final Factory factory = getFactory( name );
            if ( factory != null ) {
                return new DynaTagScript(
                    new TagFactory() {
                        public Tag createTag() throws Exception {
                            return new ComponentTag(factory);
                        }
                    }
                );
View Full Code Here

        Attributes attrs
    ) throws Exception {

        if ( name.equals( "tagdef" ) ) {
            return new BeanTagScript(
                new TagFactory() {
                    public Tag createTag() {
                        return new TagDefTag( JeezTagLibrary.this );
                    }
                }
            );
        }
        if ( name.equals( "target" ) ) {
            return new BeanTagScript(
                new TagFactory() {
                    public Tag createTag() {
                        return new TargetTag();
                    }
                }
            );
        }
        TagScript script = this.werkzTagLib.createTagScript( name, attrs );
        if ( script == null ) {
            script = antTagLib.createCustomTagScript( name, attrs );
            if ( script == null ) {
                return new DynaTagScript(
                    new TagFactory() {
                        public Tag createTag() throws Exception {
                            // lets try create a dynamic tag first
                            Tag tag = JeezTagLibrary.this.createTag(name);
                            if ( tag != null ) {
                                return tag;
View Full Code Here

    public TagScript createTagScript(final String name, Attributes attributes) throws Exception {

        TagScript answer = createCustomTagScript(name, attributes);
        if ( answer == null ) {
            answer = new DynaTagScript(
                new TagFactory() {
                    public Tag createTag() throws Exception {
                        return AntTagLibrary.this.createTag(name);
                    }
                }
            );
View Full Code Here

     */
    public TagScript createCustomTagScript(final String name, Attributes attributes) throws Exception {
        // custom Ant tags
        if ( name.equals("fileScanner") ) {     
            return new BeanTagScript(
                new TagFactory() {
                    public Tag createTag() throws Exception {
                        return new FileScannerTag(new FileScanner());
                    }
                }
            );     
View Full Code Here

       
        final Class beanClass = theClass;
        final Method invokeMethod = getInvokeMethod( theClass );
        final Map beanAttributes = (attributes != null) ? attributes : EMPTY_MAP;
       
        TagFactory factory = new TagFactory() {
            public Tag createTag() {
                return  new DynamicBeanTag(beanClass, beanAttributes, varAttribute, invokeMethod);
            }
        };
        getTagLibrary().registerBeanTag(name, factory);
View Full Code Here

    }
       
        final DynaClass theDynaClass = dynaClass;
        final Map beanAttributes = (attributes != null) ? attributes : EMPTY_MAP;
       
        TagFactory factory = new TagFactory() {
            public Tag createTag() {
                return  new DynamicDynaBeanTag(theDynaClass, beanAttributes, varAttribute);
            }
        };
        getTagLibrary().registerBeanTag(name, factory);
View Full Code Here

        Attributes list)
        throws SAXException {
        try {
            StaticTag tag = new StaticTag( namespaceURI, localName, qName );
            StaticTagScript script = new StaticTagScript(
                new TagFactory() {
                    public Tag createTag() {
                        return new StaticTag( namespaceURI, localName, qName );  
                    }
                }
            );
View Full Code Here

    /** Creates a new script to execute the given tag name and attributes */
    public TagScript createTagScript(final String name, final Attributes attributes)
        throws Exception {

        return new DynaTagScript(
            new TagFactory() {
                public Tag createTag() throws Exception {
                    Tag answer = DynamicTagLibrary.this.createTag(name);
                   
                    // delegate to my parent instead
                    if ( answer == null && parent != null ) {
View Full Code Here

        if ( value instanceof Script ) {           
            Script template = (Script) value;
            return new DynamicTag(template);
        }
        else if ( value instanceof TagFactory ) {
            TagFactory factory = (TagFactory) value;
            return factory.createTag();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.jelly.impl.TagFactory

Copyright © 2018 www.massapicom. 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.