Package org.apache.sling.commons.compiler

Examples of org.apache.sling.commons.compiler.CompilationUnit


    private CompilationUnit createCompileUnit(final String sourceFile, final Session session)
    throws RepositoryException, IOException {
        final Source source = readTextResource(sourceFile, session);
        final String packageName = extractPackageName(source.contents);

        return new CompilationUnit() {

            /**
             * @see org.apache.sling.commons.compiler.CompilationUnit#getMainClassName()
             */
            public String getMainClassName() {
View Full Code Here


        implements ClassLoaderWriter {

    public void testJava5Support() throws Exception {
        String sourceFile = "Java5Test";

        CompilationUnit unit = createCompileUnit(sourceFile);
        final Options options = new Options();
        options.put(Options.KEY_SOURCE_VERSION, Options.VERSION_1_5);
        options.put(Options.KEY_CLASS_LOADER_WRITER, this);
        options.put(Options.KEY_CLASS_LOADER, this.getClass().getClassLoader());
View Full Code Here

    }

    //--------------------------------------------------------< misc. helpers >

    private CompilationUnit createCompileUnit(final String sourceFile) throws Exception {
        return new CompilationUnit() {

            /**
             * @see org.apache.sling.commons.compiler.CompilationUnit#getMainClassName()
             */
            public String getMainClassName() {
View Full Code Here

        final String sourceFile = ctxt.getServletJavaFileName();
        final String packageName = ctxt.getServletPackageName();
        final String targetClassName =
            ((packageName.length() != 0) ? (packageName + ".") : "")
                    + ctxt.getServletClassName();
        final CompilationUnit unit = new CompilationUnitWithSource() {

            /**
             * @see org.apache.sling.commons.compiler.CompilationUnit#getLastModified()
             */
            public long getLastModified() {
View Full Code Here

TOP

Related Classes of org.apache.sling.commons.compiler.CompilationUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.