You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/10/10 00:22:37 UTC
svn commit: r454535 - in /myfaces/tobago/trunk/tobago-tool:
gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/
maven-apt-plugin/
maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/
maven-theme-plugin/src/main/java/org/apache/...
Author: bommel
Date: Mon Oct 9 15:22:36 2006
New Revision: 454535
URL: http://svn.apache.org/viewvc?view=rev&rev=454535
Log:
fixed checkstyle errors
Modified:
myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/Controller.java
myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java
myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml
myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AbstractAPTMojo.java
myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AllSourcesInclusionScanner.java
myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AptMojo.java
myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/TestAptMojo.java
myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java
myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/PackThemeMojo.java
myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/UnPackThemeMojo.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Facet.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java
Modified: myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/Controller.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/Controller.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/Controller.java (original)
+++ myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/Controller.java Mon Oct 9 15:22:36 2006
@@ -16,21 +16,19 @@
* limitations under the License.
*/
-import org.apache.myfaces.tobago.taglib.component.InTag;
import org.apache.myfaces.tobago.taglib.component.ButtonTag;
import org.apache.myfaces.tobago.taglib.component.LinkTag;
import org.apache.myfaces.tobago.taglib.extension.InExtensionTag;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.faces.webapp.UIComponentTag;
import javax.servlet.jsp.tagext.TagSupport;
import java.util.List;
import java.util.ArrayList;
public class Controller {
- private Log LOG = LogFactory.getLog(Controller.class);
+ private static final Log LOG = LogFactory.getLog(Controller.class);
private List<TagData> tags;
Modified: myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java (original)
+++ myfaces/tobago/trunk/tobago-tool/gendoc/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java Mon Oct 9 15:22:36 2006
@@ -1,12 +1,5 @@
package org.apache.myfaces.tobago.example.reference;
-import org.apache.myfaces.tobago.util.VariableResolverUtil;
-
-import javax.servlet.jsp.tagext.TagSupport;
-import javax.servlet.jsp.JspException;
-import javax.faces.webapp.UIComponentTag;
-import javax.faces.context.FacesContext;
-
/*
* Copyright 2002-2006 The Apache Software Foundation.
*
@@ -23,6 +16,12 @@
* limitations under the License.
*/
+import org.apache.myfaces.tobago.util.VariableResolverUtil;
+
+import javax.servlet.jsp.tagext.TagSupport;
+import javax.servlet.jsp.JspException;
+import javax.faces.context.FacesContext;
+
public class DynamicTag extends TagSupport {
private String controllerName;
@@ -30,7 +29,8 @@
public int doStartTag() throws JspException {
// fixme: session?
- Controller controller = (Controller) VariableResolverUtil.resolveVariable(FacesContext.getCurrentInstance(), controllerName);
+ Controller controller =
+ (Controller) VariableResolverUtil.resolveVariable(FacesContext.getCurrentInstance(), controllerName);
// Controller controller = (Controller) pageContext.getSession().getAttribute(controllerName);
if (controller != null) {
tag = controller.createTag();
Modified: myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml Mon Oct 9 15:22:36 2006
@@ -21,6 +21,8 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>config/maven_checks.xml</configLocation>
+ <excludes>**/*.java</excludes>
+ <sourceEncoding>utf-8</sourceEncoding>
<xrefLocation>xref</xrefLocation>
</configuration>
</plugin>
@@ -50,4 +52,25 @@
<version>1.2</version>
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>generate-site</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AbstractAPTMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AbstractAPTMojo.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AbstractAPTMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AbstractAPTMojo.java Mon Oct 9 15:22:36 2006
@@ -3,7 +3,7 @@
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
- * Licensed under the Apache License, Version 2.0(the "License");
+ * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -48,11 +48,14 @@
*/
public abstract class AbstractAPTMojo extends AbstractMojo
{
- private static final String PATH_SEPARATOR = //
- System.getProperty( "path.separator" );
-
- private static final String FILE_SEPARATOR = //
- System.getProperty( "file.separator" );
+ /**
+ * PATH_SEPARATOR.
+ */
+ private static final String PATH_SEPARATOR = System.getProperty( "path.separator" );
+ /**
+ * FILE_SEPARATOR.
+ */
+ private static final String FILE_SEPARATOR = System.getProperty( "file.separator" );
/**
* Integer returned by the Apt compiler to indicate success.
@@ -65,11 +68,14 @@
private static final String APT_ENTRY_POINT = "com.sun.tools.apt.Main";
/**
- * method used to compile.
+ * method used for apt.
*/
private static final String APT_METHOD_NAME = "process";
- private static final String APT_METHOD_NAME_OLD = "compile";
+ /**
+ * old method used for apt.
+ */
+ private static final String APT_METHOD_NAME_OLD = "compile";
/**
* store info about modification of system classpath for Apt compiler
@@ -81,21 +87,21 @@
*
* @parameter
*/
- protected List targetFiles;
+ private List targetFiles;
/**
* enables resource filtering for generated resources
*
* @parameter default-value="false"
*/
- protected boolean resourceFiltering;
+ private boolean resourceFiltering;
/**
* targetPath for generated resources
*
* @parameter
*/
- protected String resourceTargetPath;
+ private String resourceTargetPath;
/**
* Whether to include debugging information in the compiled class files. The
@@ -146,7 +152,7 @@
*
* @parameter expression="${verbose}" default-value="false"
*/
- protected boolean verbose;
+ private boolean verbose;
/**
* The -nocompile argument for the Apt
@@ -161,7 +167,7 @@
*
* @parameter expression="${lastModGranularityMs}" default-value="0"
*/
- protected int staleMillis;
+ private int staleMillis;
/**
* Name of AnnotationProcessorFactory to use; bypasses default discovery
@@ -201,7 +207,7 @@
*
* @parameter default-value="false"
*/
- protected boolean force;
+ private boolean force;
/**
@@ -211,24 +217,108 @@
* @required
* @readonly
*/
- protected MavenProject project;
+ private MavenProject project;
- protected abstract List getClasspathElements();
+ /**
+ * The maven project.
+ * @return MavenProject
+ */
+ public MavenProject getProject()
+ {
+ return project;
+ }
+ /**
+ * Force apt call without staleness checking.
+ * @return force
+ */
+ public boolean isForce()
+ {
+ return force;
+ }
+ /**
+ * run Apt in verbode mode
+ * @return verbose
+ */
+ public boolean isVerbose()
+ {
+ return verbose;
+ }
+ /**
+ * The granularity in milliseconds of the last modification date for testing
+ * whether a source needs recompilation
+ * @return staleMillis
+ */
+ public int getStaleMillis()
+ {
+ return staleMillis;
+ }
+ /**
+ * A List of targetFiles for SingleSourceTargetMapping
+ * @return a List of TargetFiles
+ */
+ protected List getTargetFiles()
+ {
+ return targetFiles;
+ }
+ /**
+ * enables resource filtering for generated resources
+ * @return resourceFiltering
+ */
+ protected boolean isResourceFiltering()
+ {
+ return resourceFiltering;
+ }
+ /**
+ * targetPath for generated resources
+ * @return resouceTargetPath
+ */
+ protected String getResourceTargetPath()
+ {
+ return resourceTargetPath;
+ }
+ /**
+ * classpath elements.
+ * @return a List of classPathElements
+ */
+ protected abstract List getClasspathElements();
+ /**
+ * The source directories containing the sources to be compiled.
+ * @return a List of CompileSourceRoots
+ */
protected abstract List getCompileSourceRoots();
+ /**
+ * The extra source directories containing the source to be processed.
+ * @return a List of AptSourceRoots
+ */
protected abstract List getAptSourceRoots();
+ /**
+ * The directory where compiled classes go.
+ * @return outputDirector
+ */
protected abstract File getOutputDirectory();
+ /**
+ * The directory where generated code go.
+ * @return generated
+ */
protected abstract String getGenerated();
+ /**
+ *
+ * @return a SourceInclusionScanner
+ */
protected abstract SourceInclusionScanner getSourceInclusionScanner();
- public void execute() throws MojoExecutionException
+ /**
+ * execute
+ * @throws MojoExecutionException
+ */
+ public void execute() throws MojoExecutionException
{
getLog().debug( "Using apt compiler" );
- //List cmd = new LinkedList();
Commandline cmd = new Commandline();
int result = APT_COMPILER_SUCCESS;
StringWriter writer = new StringWriter();
@@ -236,22 +326,18 @@
{
tempRoot.mkdirs();
}
- //File workingDir =
- // finally invoke APT
// Use reflection to be able to build on all JDKs:
try
{
-
// init comand line
setAptCommandlineSwitches( cmd );
setAptSpecifics( cmd );
setStandards( cmd );
setClasspath( cmd );
List sourceFiles = new ArrayList();
-
- if( !setSourcepath( sourceFiles ) )
+ if ( !setSourcepath( sourceFiles ) )
{
- if( getLog().isDebugEnabled() )
+ if ( getLog().isDebugEnabled() )
{
getLog().debug( "there are not stale sources." );
}
@@ -259,13 +345,10 @@
}
else
{
-
- if ( fork)
+ if ( fork )
{
-
File file = new File( tempRoot , "files" );
-
- if( !getLog().isDebugEnabled())
+ if ( !getLog().isDebugEnabled() )
{
file.deleteOnExit();
}
@@ -275,7 +358,6 @@
StringUtils.join( sourceFiles.iterator(), "\n" ) );
cmd.createArgument().setValue( "@files" );
}
-
catch ( IOException e )
{
throw new MojoExecutionException( "Unable to write temporary file for command execution", e );
@@ -286,25 +368,22 @@
Iterator sourceIt = sourceFiles.iterator();
while ( sourceIt.hasNext() )
{
- cmdAdd(cmd, (String) sourceIt.next());
+ cmdAdd( cmd, (String) sourceIt.next() );
}
}
-
-
-
}
- if( fork )
+ if ( fork )
{
- if( getLog().isDebugEnabled() )
+ if ( getLog().isDebugEnabled() )
{
getLog().debug( "Working dir: " + tempRoot.getAbsolutePath() );
}
cmd.setWorkingDirectory( tempRoot.getAbsolutePath() );
cmd.setExecutable( getAptPath() );
- if( getLog().isDebugEnabled() )
+ if ( getLog().isDebugEnabled() )
{
- getLog().debug( "Invoking apt with cmd " +Commandline.toString( cmd.getShellCommandline() ) );
+ getLog().debug( "Invoking apt with cmd " + Commandline.toString( cmd.getShellCommandline() ) );
}
CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
@@ -312,7 +391,7 @@
{
int exitCode = CommandLineUtils.executeCommandLine( cmd, new DefaultConsumer(), err );
- getLog().error(err.getOutput());
+ getLog().error( err.getOutput() );
if ( exitCode != 0 )
{
@@ -329,7 +408,7 @@
// we need to have tools.jar in lasspath
// due to bug in Apt compiler, system classpath must be modified but in future:
// TODO try separate ClassLoader (see Plexus compiler api)
- if( !isClasspathModified )
+ if ( !isClasspathModified )
{
URL toolsJar = new File( System.getProperty( "java.home" ),
"../lib/tools.jar" ).toURL();
@@ -342,26 +421,26 @@
}
Class c = this.getClass().forName( APT_ENTRY_POINT ); // getAptCompilerClass();
Object compiler = c.newInstance();
- if( getLog().isDebugEnabled() )
+ if ( getLog().isDebugEnabled() )
{
getLog().debug( "Invoking apt with cmd " + cmd.toString() );
}
try
{
Method compile = c.getMethod( APT_METHOD_NAME, new Class[] {
- PrintWriter.class, (new String[] {}).getClass() } );
- result = ((Integer) //
+ PrintWriter.class, ( new String[] {} ).getClass() } );
+ result = ( ( Integer ) //
compile.invoke( compiler, new Object[] { new PrintWriter( writer ),
- cmd.getArguments()} )).intValue();
+ cmd.getArguments() } ) ).intValue();
}
- catch(NoSuchMethodException e)
+ catch ( NoSuchMethodException e )
{
// ignore
Method compile = c.getMethod( APT_METHOD_NAME_OLD, new Class[] {
- (new String[] {}).getClass(), PrintWriter.class } );
- result = ((Integer) //
+ ( new String[] {} ).getClass(), PrintWriter.class } );
+ result = ( ( Integer ) //
compile.invoke( compiler, new Object[] {
- cmd.getArguments(), new PrintWriter( writer )} )).intValue();
+ cmd.getArguments(), new PrintWriter( writer ) } ) ).intValue();
}
}
@@ -373,15 +452,14 @@
}
finally
{
- if( result != APT_COMPILER_SUCCESS )
+ if ( result != APT_COMPILER_SUCCESS )
{
- throw new MojoExecutionException( this, "Compilation error.",
- writer.getBuffer().toString() );
+ throw new MojoExecutionException( this, "Compilation error.", writer.getBuffer().toString() );
}
- if( getLog().isDebugEnabled() )
+ if ( getLog().isDebugEnabled() )
{
String r = writer.getBuffer().toString();
- if( 0 != r.length() )
+ if ( 0 != r.length() )
{
getLog().debug( r );
}
@@ -390,17 +468,21 @@
}
}
+ /**
+ *
+ * @param cmd
+ */
private void setAptCommandlineSwitches( Commandline cmd )
{
- if( null == aptOptions )
+ if ( null == aptOptions )
{
return;
}
StringTokenizer tokenizer = new StringTokenizer( aptOptions.trim(), "," );
- while( tokenizer.hasMoreElements() )
+ while ( tokenizer.hasMoreElements() )
{
String option = tokenizer.nextToken().trim();
- if( !option.startsWith( "-A" ) )
+ if ( !option.startsWith( "-A" ) )
{
option = "-A" + option;
}
@@ -408,6 +490,11 @@
}
}
+ /**
+ *
+ * @param cmd
+ * @throws MojoExecutionException
+ */
private void setAptSpecifics( Commandline cmd ) throws MojoExecutionException
{
try
@@ -416,92 +503,117 @@
+ getGenerated();
File generatedDir = new File( g );
cmdAdd( cmd, "-s", generatedDir.getCanonicalPath() );
- if( !generatedDir.exists() )
+ if ( !generatedDir.exists() )
{
generatedDir.mkdirs();
}
- } catch ( Exception e )
+ }
+ catch ( Exception e )
{
throw new MojoExecutionException( //
"Generated directory is invalid.", e );
}
- if( nocompile )
+ if ( nocompile )
{
cmdAdd( cmd, "-nocompile" );
}
- if( null != factory && 0 != factory.length() )
+ if ( null != factory && 0 != factory.length() )
{
cmdAdd( cmd, "-factory", factory );
}
}
+ /**
+ *
+ * @param cmd
+ * @throws MojoExecutionException
+ */
private void setStandards( Commandline cmd ) throws MojoExecutionException
{
- if( debug )
+ if ( debug )
{
cmdAdd( cmd, "-g" );
}
- if( !showWarnings )
+ if ( !showWarnings )
{
cmdAdd( cmd, "-nowarn" );
}
- if( showDeprecation )
+ if ( showDeprecation )
{
cmdAdd( cmd, "-depecation" );
}
- if( null != encoding )
+ if ( null != encoding )
{
cmdAdd( cmd, "-encoding", encoding );
}
- if( verbose )
+ if ( verbose )
{
cmdAdd( cmd, "-verbose" );
}
// add output directory
try
{
- if( !getOutputDirectory().exists() )
+ if ( !getOutputDirectory().exists() )
{
getOutputDirectory().mkdirs();
}
- cmdAdd( cmd, "-d", quotedPathArgument(getOutputDirectory().getCanonicalPath()) );
- } catch ( Exception ex )
+ cmdAdd( cmd, "-d", quotedPathArgument( getOutputDirectory().getCanonicalPath() ) );
+ }
+ catch ( Exception ex )
{
throw new MojoExecutionException( //
"Output directory is invalid.", ex );
}
}
+ /**
+ *
+ * @param cmd
+ * @return
+ * @throws MojoExecutionException
+ */
private boolean setSourcepath( List cmd ) throws MojoExecutionException
{
boolean has = false;
// sources ....
Iterator it = getCompileSourceRoots().iterator();
- if( getLog().isDebugEnabled() ) {
- getLog().debug("Checking sourcepath");
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug( "Checking sourcepath" );
}
- while( it.hasNext() )
+ while ( it.hasNext() )
{
File srcFile = new File( (String) it.next() );
- has = addIncludedSources(srcFile, cmd, has);
+ has = addIncludedSources( srcFile, cmd, has );
}
List aptSourcesRoots = getAptSourceRoots();
- if( aptSourcesRoots != null) {
+ if ( aptSourcesRoots != null )
+ {
it = aptSourcesRoots.iterator();
- while( it.hasNext() )
+ while ( it.hasNext() )
{
File srcFile = new File( (String) it.next() );
- has = addIncludedSources(srcFile, cmd, has);
+ has = addIncludedSources( srcFile, cmd, has );
}
}
return has;
}
- private boolean addIncludedSources(File srcFile, List cmd, boolean has) throws MojoExecutionException {
- if( getLog().isDebugEnabled() ) {
- getLog().debug("Checking sourcepath in " + srcFile);
+ /**
+ *
+ * @param srcFile
+ * @param cmd
+ * @param has
+ * @return
+ * @throws MojoExecutionException
+ */
+ private boolean addIncludedSources( File srcFile, List cmd, boolean has ) throws MojoExecutionException
+ {
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug( "Checking sourcepath in " + srcFile );
}
- if( srcFile.isDirectory() )
+ if ( srcFile.isDirectory() )
{
Collection sources = null;
try
@@ -509,27 +621,28 @@
sources = //
getSourceInclusionScanner().getIncludedSources( srcFile,
getOutputDirectory() );
- } catch ( Exception ex )
+ }
+ catch ( Exception ex )
{
throw new MojoExecutionException(
"Can't agregate sources.", ex );
}
- if( getLog().isDebugEnabled() )
+ if ( getLog().isDebugEnabled() )
{
getLog().debug(
"sources from: " + srcFile.getAbsolutePath() );
String s = "";
- for( Iterator jt = sources.iterator(); jt.hasNext(); )
+ for ( Iterator jt = sources.iterator(); jt.hasNext();)
{
s += jt.next() + "\n";
}
getLog().debug( s );
}
Iterator jt = sources.iterator();
- while( jt.hasNext() )
+ while ( jt.hasNext() )
{
File src = (File) jt.next();
- if( fork )
+ if ( fork )
{
cmd.add( quotedPathArgument( src.getAbsolutePath() ) );
}
@@ -543,12 +656,19 @@
return has;
}
- private void setClasspath( Commandline cmd ) throws MojoExecutionException, DependencyResolutionRequiredException {
+ /**
+ *
+ * @param cmd
+ * @throws MojoExecutionException
+ * @throws DependencyResolutionRequiredException
+ */
+ private void setClasspath( Commandline cmd ) throws MojoExecutionException, DependencyResolutionRequiredException
+ {
StringBuffer buffer = new StringBuffer();
- for( Iterator it = getClasspathElements().iterator(); it.hasNext(); )
+ for ( Iterator it = getClasspathElements().iterator(); it.hasNext();)
{
buffer.append( it.next() );
- if( it.hasNext() )
+ if ( it.hasNext() )
{
buffer.append( PATH_SEPARATOR );
}
@@ -556,6 +676,11 @@
cmdAdd( cmd, "-classpath", buffer.toString() );
}
+ /**
+ *
+ * @param cmd
+ * @param arg
+ */
private void cmdAdd( Commandline cmd, String arg )
{
/**
@@ -563,10 +688,16 @@
* if( true == getLog().isDebugEnabled() ) { getLog().debug(
* arg ); }
*/
- cmd.createArgument().setValue(arg);
+ cmd.createArgument().setValue( arg );
//cmd.add( arg );
}
+ /**
+ *
+ * @param cmd
+ * @param arg1
+ * @param arg2
+ */
private void cmdAdd( Commandline cmd, String arg1, String arg2 )
{
/**
@@ -585,16 +716,20 @@
*/
private String getAptPath()
{
- String aptCommand = "apt" + ( Os.isFamily("windows")? ".exe" : "" );
+ String aptCommand = "apt";
+ if ( Os.isFamily( "windows" ) )
+ {
+ aptCommand = "apt.exe";
+ }
File aptExe;
// For IBM's JDK 1.2
- if ( Os.isName("aix") )
+ if ( Os.isName( "aix" ) )
{
aptExe = new File( System.getProperty( "java.home" ) + "/../sh", aptCommand );
}
- else if ( Os.isFamily("unix") && Os.isFamily("mac") )
+ else if ( Os.isFamily( "unix" ) && Os.isFamily( "mac" ) )
{
aptExe = new File( System.getProperty( "java.home" ) + "/bin", aptCommand );
}
@@ -608,6 +743,11 @@
return aptExe.getAbsolutePath();
}
+ /**
+ *
+ * @param value
+ * @return quotedPathArgument
+ */
private String quotedPathArgument( String value )
{
String path = value;
@@ -615,14 +755,14 @@
if ( !StringUtils.isEmpty( path ) )
{
path = path.replace( '\\', '/' );
- if( path.indexOf( "\'" ) != -1 )
+ if ( path.indexOf( "\'" ) != -1 )
{
String split[] = path.split( "\'" );
path = "";
- for( int i = 0; i < split.length; i++ )
+ for ( int i = 0; i < split.length; i++ )
{
- if( i != split.length - 1)
+ if ( i != split.length - 1 )
{
path = path + split[i] + "\\'";
}
Modified: myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AllSourcesInclusionScanner.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AllSourcesInclusionScanner.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AllSourcesInclusionScanner.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AllSourcesInclusionScanner.java Mon Oct 9 15:22:36 2006
@@ -1,3 +1,5 @@
+package org.apache.myfaces.maven.plugin;
+
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
@@ -13,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.maven.plugin;
import org.codehaus.plexus.compiler.util.scan.AbstractSourceInclusionScanner;
import org.codehaus.plexus.compiler.util.scan.InclusionScanException;
@@ -22,28 +23,49 @@
import java.util.HashSet;
import java.util.Set;
+/**
+ *
+ */
public class AllSourcesInclusionScanner extends AbstractSourceInclusionScanner
{
+ /**
+ *
+ */
private Set sourceIncludes;
+ /**
+ *
+ */
private Set sourceExcludes;
- public AllSourcesInclusionScanner( Set sourceIncludes,
- Set sourceExcludes )
+ /**
+ *
+ * @param sourceIncludeSet
+ * @param sourceExcludeSet
+ */
+ public AllSourcesInclusionScanner( Set sourceIncludeSet,
+ Set sourceExcludeSet )
{
- this.sourceIncludes = sourceIncludes;
- this.sourceExcludes = sourceExcludes;
+ this.sourceIncludes = sourceIncludeSet;
+ this.sourceExcludes = sourceExcludeSet;
}
+ /**
+ *
+ * @param sourceDir
+ * @param targetDir
+ * @return
+ * @throws InclusionScanException
+ */
public Set getIncludedSources( File sourceDir, File targetDir )
throws InclusionScanException
{
- String[] sourceNames = scanForSources(sourceDir, sourceIncludes, sourceExcludes);
+ String[] sourceNames = scanForSources( sourceDir, sourceIncludes, sourceExcludes );
Set sources = new HashSet();
for ( int i = 0; i < sourceNames.length; i++ )
{
String path = sourceNames[i];
File sourceFile = new File( sourceDir, path );
- sources.add(sourceFile);
+ sources.add( sourceFile );
}
return sources;
}
Modified: myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AptMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AptMojo.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AptMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/AptMojo.java Mon Oct 9 15:22:36 2006
@@ -110,17 +110,17 @@
public void execute() throws MojoExecutionException
{
super.execute();
- File absoluteGeneratedPath = new File( project.getBasedir(), getGenerated() );
- project.addCompileSourceRoot( absoluteGeneratedPath.getPath() );
+ File absoluteGeneratedPath = new File( getProject().getBasedir(), getGenerated() );
+ getProject().addCompileSourceRoot( absoluteGeneratedPath.getPath() );
Resource resource = new Resource();
- resource.setFiltering(resourceFiltering);
- if ( resourceTargetPath != null )
+ resource.setFiltering( isResourceFiltering() );
+ if ( getResourceTargetPath() != null )
{
- resource.setTargetPath(resourceTargetPath);
+ resource.setTargetPath( getResourceTargetPath() );
}
resource.setDirectory( absoluteGeneratedPath.getPath() );
resource.addExclude( "**/*.java" );
- project.addResource( resource );
+ getProject().addResource( resource );
}
/**
@@ -141,23 +141,23 @@
{
StaleSourceScanner scanner = null;
- if( includes.isEmpty() )
+ if ( includes.isEmpty() )
{
includes.add( "**/*.java" );
}
- if (force)
+ if ( isForce() )
{
- return new AllSourcesInclusionScanner(includes, excludes);
+ return new AllSourcesInclusionScanner( includes, excludes );
}
- scanner = new StaleSourceScanner( staleMillis, includes, excludes );
- if ( targetFiles!=null && targetFiles.size() > 0 )
+ scanner = new StaleSourceScanner( getStaleMillis(), includes, excludes );
+ if ( getTargetFiles() != null && getTargetFiles().size() > 0 )
{
- for ( Iterator it = targetFiles.iterator() ; it.hasNext() ; )
+ for ( Iterator it = getTargetFiles().iterator() ; it.hasNext() ;)
{
String file = (String) it.next();
- scanner.addSourceMapping( new SingleTargetSourceMapping(".java", file ) );
+ scanner.addSourceMapping( new SingleTargetSourceMapping( ".java", file ) );
}
}
else
Modified: myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/TestAptMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/TestAptMojo.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/TestAptMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/src/main/java/org/apache/myfaces/maven/plugin/TestAptMojo.java Mon Oct 9 15:22:36 2006
@@ -105,24 +105,25 @@
public void execute() throws MojoExecutionException
{
- if( skip )
+ if ( skip )
{
//getLog().info( "Not executing test sources" );
return;
- } else
+ }
+ else
{
super.execute();
- File absoluteGeneratedPath = new File( project.getBasedir(), getGenerated() );
- project.addTestCompileSourceRoot( absoluteGeneratedPath.getPath() );
+ File absoluteGeneratedPath = new File( getProject().getBasedir(), getGenerated() );
+ getProject().addTestCompileSourceRoot( absoluteGeneratedPath.getPath() );
Resource resource = new Resource();
- resource.setFiltering(resourceFiltering);
- if ( resourceTargetPath != null )
+ resource.setFiltering( isResourceFiltering() );
+ if ( getResourceTargetPath() != null )
{
- resource.setTargetPath(resourceTargetPath);
+ resource.setTargetPath( getResourceTargetPath() );
}
resource.setDirectory( absoluteGeneratedPath.getPath() );
resource.addExclude( "**/*.java" );
- project.addTestResource( resource );
+ getProject().addTestResource( resource );
}
}
@@ -155,22 +156,22 @@
{
StaleSourceScanner scanner = null;
- if( testIncludes.isEmpty() )
+ if ( testIncludes.isEmpty() )
{
testIncludes.add( "**/*.java" );
}
- if (force)
+ if ( isForce() )
{
- return new AllSourcesInclusionScanner(testIncludes, testExcludes);
+ return new AllSourcesInclusionScanner( testIncludes, testExcludes );
}
- scanner = new StaleSourceScanner( staleMillis, testIncludes, testExcludes );
- if ( targetFiles!=null && targetFiles.size() > 0 )
+ scanner = new StaleSourceScanner( getStaleMillis(), testIncludes, testExcludes );
+ if ( getTargetFiles() != null && getTargetFiles().size() > 0 )
{
- for ( Iterator it = targetFiles.iterator() ; it.hasNext() ; )
+ for ( Iterator it = getTargetFiles().iterator() ; it.hasNext() ;)
{
String file = (String) it.next();
- scanner.addSourceMapping( new SingleTargetSourceMapping(".java", file ) );
+ scanner.addSourceMapping( new SingleTargetSourceMapping( ".java", file ) );
}
}
else
Modified: myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java Mon Oct 9 15:22:36 2006
@@ -47,7 +47,7 @@
scanner.setBasedir(sourceDir);
scanner.setIncludes(new String[]{"**"});
scanner.setExcludes(new String [] {"META-INF/**/*",
- "**/*.properties", "**/*.xml","**/*.class",});
+ "**/*.properties", "**/*.xml", "**/*.class"});
scanner.scan();
return scanner.getIncludedFiles();
}
Modified: myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/PackThemeMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/PackThemeMojo.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/PackThemeMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/PackThemeMojo.java Mon Oct 9 15:22:36 2006
@@ -113,7 +113,7 @@
/**
* Executes the WarMojo on the current project.
*
- * @throws org.apache.myfaces.maven.plugin.MojoExecutionException
+ * @throws MojoExecutionException
* if an error occured while building the webapp
*/
public void execute()
@@ -122,10 +122,9 @@
try {
performPackaging(jarFile);
- projectHelper.attachArtifact(getProject(), "jar", "THEME", jarFile );
- //getProject().getArtifact().setFile(jarFile);
- }
- catch (Exception e) {
+ projectHelper.attachArtifact(getProject(), "jar", "THEME", jarFile);
+
+ } catch (Exception e) {
// TODO: improve error handling
throw new MojoExecutionException("Error assembling theme", e);
}
@@ -153,8 +152,7 @@
copyResources(getWarSourceDirectory(), zipDirectory);
buildTheme(getProject(), getWebappDirectory());
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new MojoExecutionException("Could not explode theme...", e);
}
}
@@ -198,4 +196,4 @@
return new String[]{"**"};
}
-}
\ No newline at end of file
+}
Modified: myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/UnPackThemeMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/UnPackThemeMojo.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/UnPackThemeMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/UnPackThemeMojo.java Mon Oct 9 15:22:36 2006
@@ -1,4 +1,5 @@
package org.apache.myfaces.tobago.maven.plugin;
+
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
@@ -15,8 +16,6 @@
* limitations under the License.
*/
-
-
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.plexus.archiver.ArchiverException;
@@ -49,7 +48,7 @@
* @parameter expression="${component.org.codehaus.plexus.archiver.manager.ArchiverManager}"
* @required
*/
- protected ArchiverManager archiverManager;
+ private ArchiverManager archiverManager;
/**
* Directory to unpack JARs into if needed
@@ -57,7 +56,7 @@
* @parameter expression="${project.build.directory}/theme/work"
* @required
*/
- protected File workDirectory;
+ private File workDirectory;
/**
* The directory where the webapp is built.
@@ -112,8 +111,8 @@
Artifact artifact = (Artifact) artifacts.next();
getLog().debug("Expanding theme "+ artifact);
- if (Artifact.SCOPE_COMPILE.equals(artifact.getScope()) &&
- "jar".equals(artifact.getType())&& findThemeDescriptor(artifact.getFile())) {
+ if (Artifact.SCOPE_COMPILE.equals(artifact.getScope())
+ && "jar".equals(artifact.getType())&& findThemeDescriptor(artifact.getFile())) {
String name = artifact.getFile().getName();
getLog().debug("Expanding theme "+ name);
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Facet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Facet.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Facet.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Facet.java Mon Oct 9 15:22:36 2006
@@ -1,6 +1,22 @@
package org.apache.myfaces.tobago.apt.annotation;
-/**
+/*
+ * Copyright 2002-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
* Created by IntelliJ IDEA.
* User: bommel
* Date: Sep 30, 2006
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java Mon Oct 9 15:22:36 2006
@@ -110,9 +110,10 @@
try {
getEnv().getMessager().printNotice("Create facelets taglib config");
String fileName =
- taglibAnnotation.fileName().substring(0, taglibAnnotation.fileName().length()-3)+"taglib.xml";
+ taglibAnnotation.fileName().substring(0, taglibAnnotation.fileName().length()-3) + "taglib.xml";
- faceletsConfigWriter = getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(fileName), null);
+ faceletsConfigWriter =
+ getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(fileName), null);
TransformerFactory transFactory = TransformerFactory.newInstance();
transFactory.setAttribute("indent-number", 2);
Transformer transformer = transFactory.newTransformer();
@@ -123,7 +124,7 @@
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.transform(new DOMSource(document),
new StreamResult(faceletsConfigWriter));
- getEnv().getMessager().printNotice("Write to file " +packageDeclaration.getQualifiedName()+" "+fileName);
+ getEnv().getMessager().printNotice("Write to file " + packageDeclaration.getQualifiedName() + " " + fileName);
} finally{
IOUtils.closeQuietly(faceletsConfigWriter);
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java Mon Oct 9 15:22:36 2006
@@ -46,7 +46,12 @@
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.io.StringReader;
+import java.io.InputStream;
+import java.io.StringWriter;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
@@ -61,10 +66,10 @@
* Time: 9:31:09 PM
*/
public class FacesConfigAnnotationVisitor extends AbstractAnnotationVisitor {
- public static String SOURCE_FACES_CONFIG_KEY = "sourceFacesConfig";
- public static String TARGET_FACES_CONFIG_KEY = "targetFacesConfig";
+ public static final String SOURCE_FACES_CONFIG_KEY = "sourceFacesConfig";
+ public static final String TARGET_FACES_CONFIG_KEY = "targetFacesConfig";
- private static final String SEPARATOR = System.getProperty( "line.separator" );
+ private static final String SEPARATOR = System.getProperty("line.separator");
private static final String COMPONENT = "component";
private static final String COMPONENT_TYPE = "component-type";
private static final String COMPONENT_CLASS = "component-class";
@@ -95,7 +100,7 @@
public void process() throws ParserConfigurationException, IOException {
String sourceFacesConfigFile = null;
String targetFacesConfigFile = null;
- for(Map.Entry<String,String> entry: getEnv().getOptions().entrySet()) {
+ for(Map.Entry<String, String> entry: getEnv().getOptions().entrySet()) {
if (entry.getKey().startsWith("-A" + SOURCE_FACES_CONFIG_KEY + "=")) {
sourceFacesConfigFile = entry.getKey().substring(SOURCE_FACES_CONFIG_KEY.length() + 3);
}
@@ -104,11 +109,11 @@
}
}
// TODO remove the foreach
- for (PackageDeclaration packageDeclaration :getCollectedPackageDeclations()) {
+ for (PackageDeclaration packageDeclaration: getCollectedPackageDeclations()) {
Document document;
Writer writer = null;
try {
- String content = FileUtils.fileRead( sourceFacesConfigFile );
+ String content = FileUtils.fileRead(sourceFacesConfigFile);
SAXBuilder builder = new SAXBuilder();
builder.setEntityResolver(new EntityResolver() {
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
@@ -120,10 +125,10 @@
return null;
}
});
- document = builder.build( new StringReader( content ) );
+ document = builder.build(new StringReader(content));
// Normalise line endings. For some reason, JDOM replaces \r\n inside a comment with \n.
- normaliseLineEndings( document );
+ normaliseLineEndings(document);
// rewrite DOM as a string to find differences, since text outside the root element is not tracked
@@ -146,7 +151,7 @@
}
}
- for (InterfaceDeclaration decl : getCollectedInterfaceDeclations()) {
+ for (InterfaceDeclaration decl: getCollectedInterfaceDeclations()) {
if (decl.getPackage().equals(packageDeclaration)) {
addElement(decl, newComponents, namespace);
}
@@ -295,15 +300,17 @@
}
- protected void addAttribute(MethodDeclaration d, Class uiComponentClass, List properties, List attributes, Namespace namespace) {
+ protected void addAttribute(MethodDeclaration d, Class uiComponentClass, List properties, List attributes,
+ Namespace namespace) {
UIComponentTagAttribute componentAttribute = d.getAnnotation(UIComponentTagAttribute.class);
if (componentAttribute != null) {
String simpleName = d.getSimpleName();
if (simpleName.startsWith("set")) {
String attributeStr = simpleName.substring(3, 4).toLowerCase() + simpleName.substring(4);
String methodStr;
- if (componentAttribute.type().length == 1 &&
- (componentAttribute.type()[0].equals(Boolean.class.getName()) || componentAttribute.type()[0].equals("boolean"))) {
+ if (componentAttribute.type().length == 1
+ && (componentAttribute.type()[0].equals(Boolean.class.getName())
+ || componentAttribute.type()[0].equals("boolean"))) {
methodStr = "is" + simpleName.substring(3);
} else {
methodStr = "get" + simpleName.substring(3);
@@ -368,7 +375,8 @@
}
}
- protected void addAttributes(InterfaceDeclaration type, Class uiComponentClass, List properties, List attributes, Namespace namespace) {
+ protected void addAttributes(InterfaceDeclaration type, Class uiComponentClass, List properties, List attributes,
+ Namespace namespace) {
addAttributes(type.getSuperinterfaces(), uiComponentClass, properties, attributes, namespace);
for (MethodDeclaration decl : getCollectedMethodDeclations()) {
if (decl.getDeclaringType().equals(type)) {
@@ -384,7 +392,8 @@
}
}
- protected void addAttributes(ClassDeclaration d, Class uiComponentClass, List properties, List attributes, Namespace namespace) {
+ protected void addAttributes(ClassDeclaration d, Class uiComponentClass, List properties, List attributes,
+ Namespace namespace) {
for (MethodDeclaration decl : getCollectedMethodDeclations()) {
if (d.getQualifiedName().
equals(decl.getDeclaringType().getQualifiedName())) {
@@ -399,7 +408,7 @@
private void addFacets(UIComponentTag componentTag, Namespace namespace, Element element) {
- Facet facets [] = componentTag.facets();
+ Facet [] facets = componentTag.facets();
for (Facet facet: facets) {
Element facetElement = new Element(FACET, namespace);
String description = facet.description();
@@ -445,7 +454,8 @@
}
}
- protected void addElement(InterfaceDeclaration decl, List<Element> components, Namespace namespace) throws IOException {
+ protected void addElement(InterfaceDeclaration decl, List<Element> components, Namespace namespace)
+ throws IOException {
UIComponentTag componentTag = decl.getAnnotation(UIComponentTag.class);
if (componentTag != null && !componentTag.isComponentAlreadyDefined()) {
try {
@@ -474,11 +484,10 @@
}
}
- private void normaliseLineEndings( Document document ) {
- for ( Iterator i = document.getDescendants( new ContentFilter( ContentFilter.COMMENT ) );
- i.hasNext(); ) {
+ private void normaliseLineEndings(Document document) {
+ for (Iterator i = document.getDescendants(new ContentFilter(ContentFilter.COMMENT)); i.hasNext();) {
Comment c = (Comment) i.next();
- c.setText( c.getText().replaceAll( "\n", SEPARATOR) );
+ c.setText(c.getText().replaceAll("\n", SEPARATOR));
}
}
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java?view=diff&rev=454535&r1=454534&r2=454535
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java Mon Oct 9 15:22:36 2006
@@ -36,7 +36,7 @@
private static final Collection<String> SUPPORTED_ANNOTATIONS
= Collections.unmodifiableCollection(Arrays.asList("org.apache.myfaces.tobago.apt.annotation.Tag",
"org.apache.myfaces.tobago.apt.annotation.TagAttribute",
- "org.apache.myfaces.tobago.apt.annotation.Taglib" ));
+ "org.apache.myfaces.tobago.apt.annotation.Taglib"));
private static final Collection<String> SUPPORTED_OPTIONS = Collections.emptySet();