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/java/org/apache/antlib/core Log.java
Date Mon, 17 Dec 2001 10:48:40 GMT
donaldp     01/12/17 02:48:40

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/core Log.java
  Log:
  Made it possible to set message in content of element.
  
  Revision  Changes    Path
  1.2       +18 -0     jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Log.java
  
  Index: Log.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Log.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Log.java	2001/12/17 09:16:22	1.1
  +++ Log.java	2001/12/17 10:48:40	1.2
  @@ -20,8 +20,16 @@
   {
       private String      m_message;
   
  +
       public void setMessage( final String message )
       {
  +        checkNullMessage();
  +        m_message = message;
  +    }
  +
  +    public void addContent( final String message )
  +    {
  +        checkNullMessage();
           m_message = message;
       }
   
  @@ -29,5 +37,15 @@
           throws TaskException
       {
           getLogger().warn( m_message );
  +    }
  +
  +    private void checkNullMessage()
  +    {
  +        if( null != m_message )
  +        {
  +            final String message = "Message can only be set once by " +
  +                "either nested content or the message attribute";
  +            throw new IllegalStateException( message );
  +        }
       }
   }
  
  
  

--
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