Package org.xdoclet.plugin.tapestry

Source Code of org.xdoclet.plugin.tapestry.ComponentSpecificationPlugin

/*
* Copyright (c) 2003-2005
* XDoclet Team
* All rights reserved.
*/
package org.xdoclet.plugin.tapestry;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;

import org.generama.JellyTemplateEngine;
import org.generama.QDoxCapableMetadataProvider;
import org.generama.WriterMapper;

import org.generama.defaults.QDoxPlugin;
import org.generama.defaults.XMLOutputValidator;

import org.xdoclet.plugin.tapestry.qtags.TagLibrary;

import com.thoughtworks.qdox.model.BeanProperty;
import com.thoughtworks.qdox.model.DocletTag;
import com.thoughtworks.qdox.model.JavaClass;
import com.thoughtworks.qdox.model.JavaField;

/**
* Creates component-specification (.jwc) files
* @author Paolo Don�
*/
public class ComponentSpecificationPlugin extends GenericTapestryPlugin {
    public ComponentSpecificationPlugin(JellyTemplateEngine jellyTemplateEngine,
        QDoxCapableMetadataProvider metadataProvider, WriterMapper writerMapper) {
        super(jellyTemplateEngine, metadataProvider, writerMapper);
        setFileregex("\\.java");
        setFilereplace("\\.jwc");
        setPackageregex(".*");
        setPackagereplace("");
        setMultioutput(true);
        new TagLibrary(metadataProvider);
    }

    public boolean shouldGenerate(Object metadata) {
        JavaClass clazz = (JavaClass) metadata;
        boolean hasComponentTag = clazz.getTagByName("tapestry.component-specification") != null;
        boolean isAComponent = clazz.isA("org.apache.tapestry.IComponent");
        return hasComponentTag && isAComponent;
    }
}
TOP

Related Classes of org.xdoclet.plugin.tapestry.ComponentSpecificationPlugin

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.