cvs commit: jakarta-ecs/src/java/org/apache/ecs ConcreteElement.java

[email protected] 7 May 2003 10:19:23 -0000
Newsgroups gmane.comp.jakarta.ecs.devel
Message-ID <[email protected]>
rdonkin     2003/05/07 03:19:23

  Modified:    src/java/org/apache/ecs ConcreteElement.java
  Log:
  Tidied up formatting.
  
  Revision  Changes    Path
  1.30      +52 -52    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.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ConcreteElement.java	4 May 2003 08:48:38 -0000	1.29
  +++ ConcreteElement.java	7 May 2003 10:19:23 -0000	1.30
  @@ -290,78 +290,78 @@
   		@param ConcreteElement	Instance of ConcreteElement
       */
       public static void output(OutputStream out, ConcreteElement ce) 
  -	{
  -		boolean prettyPrint = ce.getPrettyPrint();
  -		int tabLevel = ce.getTabLevel();
  -		try
  -		{
  -			if (ce.registry.size() == 0)
  -			{	
  -				ce.output(out);
  -			}
  -			else
  -			{
  +    {
  +        boolean prettyPrint = ce.getPrettyPrint();
  +        int tabLevel = ce.getTabLevel();
  +        try
  +        {
  +            if (ce.registry.size() == 0)
  +            {	
  +                ce.output(out);
  +            }
  +            else
  +            {
                   if ((prettyPrint && ce instanceof Printable) && (tabLevel > 0))
  -					ce.putTabs(tabLevel, out);
  +                    ce.putTabs(tabLevel, out);
   
  -				out.write(ce.createStartTag().getBytes());
  +                out.write(ce.createStartTag().getBytes());
   
                   // If this is a StringElement that has ChildElements still print the TagText
                   if(ce.getTagText() != null)
                       out.write(ce.getTagText().getBytes());
   
  -				Enumeration enum = ce.registryList.elements();
  +                Enumeration enum = ce.registryList.elements();
   
  -				while(enum.hasMoreElements())
  -				{
  -					Object obj = ce.registry.get((String)enum.nextElement());
  -					if(obj instanceof GenericElement)
  -					{
  -						Element e = (Element)obj;
  -						if (prettyPrint && ce instanceof Printable)
  -						{
  +                while(enum.hasMoreElements())
  +                {
  +                    Object obj = ce.registry.get((String)enum.nextElement());
  +                    if(obj instanceof GenericElement)
  +                    {
  +                        Element e = (Element)obj;
  +                        if (prettyPrint && ce instanceof Printable)
  +                        {
                               if ( ce.getNeedLineBreak() )
                               {
  -						    	out.write(ce.lineSeparator.getBytes());
  -							    e.setTabLevel(tabLevel + 1);
  +                                out.write(ce.lineSeparator.getBytes());
  +                                e.setTabLevel(tabLevel + 1);
                               }
  -						}
  -						e.output(out);
  -					}
  -					else
  -					{
  -						if (prettyPrint && ce instanceof Printable)
  -						{
  +                        }
  +                        e.output(out);
  +                    }
  +                    else
  +                    {
  +                        if (prettyPrint && ce instanceof Printable)
  +                        {
                               if ( ce.getNeedLineBreak() )
                               {
                                   out.write(ce.lineSeparator.getBytes());
  -							    ce.putTabs(tabLevel + 1, out);
  +                                ce.putTabs(tabLevel + 1, out);
                               }
  -						}
  -						String string = obj.toString();
  -						out.write(string.getBytes());
  -					}
  -				}
  -				if (ce.getNeedClosingTag())
  -				{
  - 					if (prettyPrint && ce instanceof Printable)
  -					{
  +                        }
  +                        String string = obj.toString();
  +                        out.write(string.getBytes());
  +                    }
  +                }
  +                if (ce.getNeedClosingTag())
  +                {
  +                    if (prettyPrint && ce instanceof Printable)
  +                    {
                           if ( ce.getNeedLineBreak() )
                           {
                               out.write(ce.lineSeparator.getBytes());
                               if (tabLevel > 0)
                                   ce.putTabs(tabLevel, out);
                           }
  -					}
  -				   out.write(ce.createEndTag().getBytes());
  -				}
  -			}
  -		}
  -		catch(IOException ioe)
  -		{
  -			ioe.printStackTrace(new PrintWriter(out));
  -		}
  -	}
  +                    }
  +                out.write(ce.createEndTag().getBytes());
  +                }
  +            }
  +        }
  +        catch(IOException ioe)
  +        {
  +            ioe.printStackTrace(new PrintWriter(out));
  +        }
  +    }
   	
       /**
           Override output(OutputStream) incase any elements are in the registry.