com.day.cq.widget
Class ExtTreeJsonWriter

java.lang.Object
  extended by com.day.cq.widget.ExtTreeJsonWriter

public class ExtTreeJsonWriter
extends Object

Writes a resource tree in JSON format. This tree can be used by the EXT tree loader.


Constructor Summary
ExtTreeJsonWriter(org.apache.sling.api.resource.ResourceResolver resolver, org.apache.commons.collections.Predicate predicate, int depth)
          Creates a new EXT tree json writer
 
Method Summary
 boolean isTidy()
          Checks the tidy flag.
 void setTidy(boolean tidy)
          Controls if the export should be nicely formatted.
 void write(Writer out, org.apache.sling.api.resource.Resource res)
          Write the given resource tree to the given writer.
 void write(Writer out, String path)
          Write the resource tree starting at path to the given writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtTreeJsonWriter

public ExtTreeJsonWriter(org.apache.sling.api.resource.ResourceResolver resolver,
                         org.apache.commons.collections.Predicate predicate,
                         int depth)
Creates a new EXT tree json writer

Parameters:
resolver - resource resolver
predicate - predicate
depth - maximal depth
Method Detail

isTidy

public boolean isTidy()
Checks the tidy flag.

Returns:
true if export is tidy.

setTidy

public void setTidy(boolean tidy)
Controls if the export should be nicely formatted.

Parameters:
tidy - set to true for tidy.

write

public void write(Writer out,
                  String path)
           throws IOException
Write the resource tree starting at path to the given writer.

Parameters:
out - writer
path - start path
Throws:
IOException - if an I/O error occurs

write

public void write(Writer out,
                  org.apache.sling.api.resource.Resource res)
           throws IOException
Write the given resource tree to the given writer.

Parameters:
out - writer
res - start resource
Throws:
IOException - if an I/O error occurs


Copyright © 2008 Day Management AG. All Rights Reserved.