ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional StyleBook.java
Date Sat, 12 Jan 2002 23:36:14 GMT
donaldp     02/01/12 15:36:14

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        StyleBook.java
  Log:
  Made sur estylebook compiled, made protected members private and moved validation code into
a separate method.
  
  Revision  Changes    Path
  1.4       +18 -15    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java
  
  Index: StyleBook.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StyleBook.java	23 Dec 2001 06:31:14 -0000	1.3
  +++ StyleBook.java	12 Jan 2002 23:36:14 -0000	1.4
  @@ -21,16 +21,15 @@
   public class StyleBook
       extends Java
   {
  -    protected File m_book;
  -    protected String m_loaderConfig;
  -    protected File m_skinDirectory;
  -    protected File m_targetDirectory;
  +    private File m_book;
  +    private String m_loaderConfig;
  +    private File m_skinDirectory;
  +    private File m_targetDirectory;
   
       public StyleBook()
       {
           setClassname( "org.apache.stylebook.StyleBook" );
           setFork( true );
  -        setFailonerror( true );
       }
   
       public void setBook( final File book )
  @@ -56,7 +55,21 @@
       public void execute()
           throws TaskException
       {
  +        validate();
   
  +        createArg().setValue( "targetDirectory=" + m_targetDirectory );
  +        createArg().setValue( m_book.toString() );
  +        createArg().setValue( m_skinDirectory.toString() );
  +        if( null != m_loaderConfig )
  +        {
  +            createArg().setValue( "loaderConfig=" + m_loaderConfig );
  +        }
  +
  +        super.execute();
  +    }
  +
  +    private void validate() throws TaskException
  +    {
           if( null == m_targetDirectory )
           {
               throw new TaskException( "TargetDirectory attribute not set." );
  @@ -71,16 +84,6 @@
           {
               throw new TaskException( "book attribute not set." );
           }
  -
  -        createArg().setValue( "targetDirectory=" + m_targetDirectory );
  -        createArg().setValue( m_book.toString() );
  -        createArg().setValue( m_skinDirectory.toString() );
  -        if( null != m_loaderConfig )
  -        {
  -            createArg().setValue( "loaderConfig=" + m_loaderConfig );
  -        }
  -
  -        super.execute();
       }
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message