jakarta-ecs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject cvs commit: jakarta-ecs/src/java/org/apache/ecs ConcreteElement.java
Date Mon, 30 Jul 2001 17:54:53 GMT
snagy       01/07/30 10:54:53

  Modified:    src/java/org/apache/ecs ConcreteElement.java
  Log:
  Submitted by: Tony Barrile
  Reviewed by: Stephan Nagy
  
  Re-Add isEmpty() and lineSeparator stuff, inadventanly got left out when i
  merged the submission.
  
  Revision  Changes    Path
  1.27      +15 -7     jakarta-ecs/src/java/org/apache/ecs/ConcreteElement.java
  
  Index: ConcreteElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ecs/src/java/org/apache/ecs/ConcreteElement.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ConcreteElement.java	2001/07/30 14:55:24	1.26
  +++ ConcreteElement.java	2001/07/30 17:54:53	1.27
  @@ -69,12 +69,15 @@
       This class is to be subclassed by those elements that are made up of
       other elements. i.e. BODY,HEAD,etc.
   
  -    @version $Id: ConcreteElement.java,v 1.26 2001/07/30 14:55:24 snagy Exp $
  +    @version $Id: ConcreteElement.java,v 1.27 2001/07/30 17:54:53 snagy Exp $
       @author <a href="mailto:snagy@servletapi.com">Stephan Nagy</a>
       @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
   */
   public class ConcreteElement extends ElementAttributes implements Cloneable
   {
  +	/** The line separator to use for pretty printing */
  +	private static String lineSeparator = System.getProperty("line.separator");
  +
       /** @serial registry registry */
       private Hashtable registry = new Hashtable(4); // keep a list of elements that need
to be added to the element
       /** Maintain an ordered list of elements */
  @@ -314,7 +317,7 @@
   						{
                               if ( ce.getNeedLineBreak() )
                               {
  -						    	out.write('\n');
  +						    	out.write(ce.lineSeparator.getBytes());
   							    e.setTabLevel(tabLevel + 1);
                               }
   						}
  @@ -326,7 +329,7 @@
   						{
                               if ( ce.getNeedLineBreak() )
                               {
  -                                out.write('\n');
  +                                out.write(ce.lineSeparator.getBytes());
   							    ce.putTabs(tabLevel + 1, out);
                               }
   						}
  @@ -340,7 +343,7 @@
   					{
                           if ( ce.getNeedLineBreak() )
                           {
  -                            out.write('\n');
  +                            out.write(ce.lineSeparator.getBytes());
                               if (tabLevel > 0)
                                   ce.putTabs(tabLevel, out);
                           }
  @@ -426,7 +429,7 @@
   					if (prettyPrint && this instanceof Printable)
   					{
                           if (getNeedLineBreak()) {
  -							out.write('\n');
  +							out.write(lineSeparator);
   							e.setTabLevel(tabLevel + 1);
   						}
   					}
  @@ -437,7 +440,7 @@
   					if (prettyPrint && this instanceof Printable)
   					{
                           if (getNeedLineBreak()) {
  -							out.write('\n');
  +							out.write(lineSeparator);
   							putTabs(tabLevel + 1, out);
   						}
   					}
  @@ -453,7 +456,7 @@
   				if (prettyPrint && this instanceof Printable)
   				{
                       if (getNeedLineBreak()) {
  -						out.write('\n');
  +						out.write(lineSeparator);
   						if (tabLevel > 0)
   							putTabs(tabLevel, out);
   					}
  @@ -492,5 +495,10 @@
           {
               throw new InternalError(ioe.toString());
           }
  +    }
  +    
  +    public boolean isEmpty()
  +    {
  +        return registryList.isEmpty();
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-dev-help@jakarta.apache.org


Mime
View raw message