org.chromattic.dataobject
Class DataObjectCompiler

java.lang.Object
  extended by org.chromattic.dataobject.DataObjectCompiler

public class DataObjectCompiler
extends java.lang.Object

The data object compiler.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
DataObjectCompiler(CompilationSource source, java.lang.String... doPaths)
          Create a new do compiler.
DataObjectCompiler(org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyCompiler compiler, CompilationSource source, java.lang.String... doPaths)
          Create a new do compiler with the provided JCR compiler.
 
Method Summary
 java.lang.Class[] generateAllClasses()
          Compiles the specified classes and returns an array containing all the classes generated during the compilation.
 java.util.Map<java.lang.String,java.lang.Class<?>> generateClasses()
          Compiles the specified classes and returns a map with a data object path as key and the corresponding compiled data object class.
 java.util.Map<java.lang.String,NodeType> generateSchema()
          Generates the node types for the specified data object paths.
 java.lang.String generateSchema(NodeTypeFormat format)
          Generates the node types for the specified data object paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataObjectCompiler

public DataObjectCompiler(org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyCompiler compiler,
                          CompilationSource source,
                          java.lang.String... doPaths)
                   throws java.lang.NullPointerException,
                          java.lang.IllegalArgumentException,
                          DataObjectException
Create a new do compiler with the provided JCR compiler.

Parameters:
compiler - the compiler to use
source - the compilation source
doPaths - the data object paths
Throws:
DataObjectException - anything that would prevent the compilation of data object
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if any data object path is null

DataObjectCompiler

public DataObjectCompiler(CompilationSource source,
                          java.lang.String... doPaths)
                   throws DataObjectException
Create a new do compiler.

Parameters:
source - the compilation source
doPaths - the data object paths
Throws:
DataObjectException - anything that would prevent the compilation of data object
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if any data object path is null
Method Detail

generateSchema

public java.lang.String generateSchema(NodeTypeFormat format)
                                throws DataObjectException,
                                       java.lang.NullPointerException,
                                       java.lang.IllegalArgumentException
Generates the node types for the specified data object paths. This operation returns the schema source in the specified format.

Parameters:
format - the schema output format
Returns:
the data object paths
Throws:
DataObjectException - anything that would prevent data object compilation
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if any data object path is null

generateSchema

public java.util.Map<java.lang.String,NodeType> generateSchema()
                                                        throws DataObjectException,
                                                               java.lang.NullPointerException,
                                                               java.lang.IllegalArgumentException
Generates the node types for the specified data object paths. This operations returns a map with the data object path as keys and the related node type as values.

Returns:
the data object paths
Throws:
DataObjectException - anything that would prevent data object compilation
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if any data object path is null

generateClasses

public java.util.Map<java.lang.String,java.lang.Class<?>> generateClasses()
                                                                   throws DataObjectException,
                                                                          java.lang.NullPointerException,
                                                                          java.lang.IllegalArgumentException
Compiles the specified classes and returns a map with a data object path as key and the corresponding compiled data object class.

Returns:
the compiled data object classes
Throws:
DataObjectException - anything that would prevent data object compilation
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if any data object path is null

generateAllClasses

public java.lang.Class[] generateAllClasses()
                                     throws DataObjectException,
                                            java.lang.NullPointerException,
                                            java.lang.IllegalArgumentException
Compiles the specified classes and returns an array containing all the classes generated during the compilation. Note that the number of returned class can be greater than the number of provided paths (classes can be generated for specific groovy needs, such as closure).

Returns:
the compiled data object classes
Throws:
DataObjectException - anything that would prevent data object compilation
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if any data object path is null


Copyright © 2013 eXo Platform SAS. All Rights Reserved.