Add stubs

This commit is contained in:
Tony Torralba
2021-06-11 11:51:16 +02:00
parent 4b491dcc50
commit 5d56eb6ea1
10 changed files with 422 additions and 15 deletions

View File

@@ -0,0 +1,34 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package groovy.lang;
public class GroovyRuntimeException extends RuntimeException {
public GroovyRuntimeException() {}
public GroovyRuntimeException(String message) {}
public GroovyRuntimeException(String message, Throwable cause) {}
public GroovyRuntimeException(Throwable t) {}
public String getMessage() {
return null;
}
public String getMessageWithoutLocationText() {
return null;
}
}

View File

@@ -1,23 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package groovy.lang;
import java.io.Reader;
import java.net.URI;
import java.util.*;
public class GroovyShell {
@@ -28,6 +26,14 @@ public class GroovyShell {
return null;
}
public Object evaluate(Reader in) {
return null;
}
public Object evaluate(Reader in, String fileName) {
return null;
}
public Object evaluate(String scriptText) {
return null;
}
@@ -48,7 +54,16 @@ public class GroovyShell {
return null;
}
public Object run(GroovyCodeSource source, List<String> args) {
public Object run(Reader in, String fileName, List<String> list) {
return null;
}
public Object run(Reader in, String fileName, String[] args) {
return null;
}
public Object run(GroovyCodeSource source, List<String> list) {
return null;
}
@@ -56,6 +71,22 @@ public class GroovyShell {
return null;
}
public Object run(URI source, List<String> list) {
return null;
}
public Object run(URI source, String[] args) {
return null;
}
public Script parse(Reader in) {
return null;
}
public Script parse(Reader reader, String fileName) {
return null;
}
public Script parse(String scriptText) {
return null;
}
@@ -63,4 +94,8 @@ public class GroovyShell {
public Script parse(final String scriptText, final String fileName) {
return null;
}
public Script parse(URI uri) {
return null;
}
}

View File

@@ -0,0 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control;
import groovy.lang.GroovyRuntimeException;
public class CompilationFailedException extends GroovyRuntimeException {
}

View File

@@ -0,0 +1,71 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control;
import groovy.lang.GroovyClassLoader;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.Iterator;
import java.util.Set;
public class CompilationUnit {
public CompilationUnit() {}
public CompilationUnit(final GroovyClassLoader loader) {}
public Set<javax.tools.JavaFileObject> getJavaCompilationUnitSet() {
return null;
}
public void addJavaCompilationUnits(
final Set<javax.tools.JavaFileObject> javaCompilationUnitSet) {}
public GroovyClassLoader getTransformLoader() {
return null;
}
public void addSources(final String[] paths) {}
public void addSources(final File[] files) {}
public SourceUnit addSource(final File file) {
return null;
}
public SourceUnit addSource(final URL url) {
return null;
}
public SourceUnit addSource(final String name, final InputStream stream) {
return null;
}
public SourceUnit addSource(final String name, final String scriptText) {
return null;
}
public SourceUnit addSource(final SourceUnit source) {
return null;
}
public Iterator<SourceUnit> iterator() {
return null;
}
public void compile() throws CompilationFailedException {}
public void compile(int throughPhase) throws CompilationFailedException {}
}

View File

@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control;
public class CompilerConfiguration {
public CompilerConfiguration() {}
public CompilerConfiguration(final CompilerConfiguration configuration) {}
public static boolean isPostJDK5(final String bytecodeVersion) {
return false;
}
public static boolean isPostJDK7(final String bytecodeVersion) {
return false;
}
public static boolean isPostJDK8(final String bytecodeVersion) {
return false;
}
public static boolean isPostJDK9(final String bytecodeVersion) {
return false;
}
}

View File

@@ -0,0 +1,51 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control;
import java.io.Serializable;
public class ErrorCollector implements Serializable {
public ErrorCollector(final CompilerConfiguration configuration) {}
public void addCollectorContents(final ErrorCollector that) {}
public void addException(final Exception exception, final SourceUnit source)
throws CompilationFailedException {}
public CompilerConfiguration getConfiguration() {
return null;
}
public int getErrorCount() {
return 0;
}
public boolean hasErrors() {
return false;
}
public int getWarningCount() {
return 0;
}
public boolean hasWarnings() {
return false;
}
public Exception getException(final int index) {
return null;
}
}

View File

@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control;
import groovy.lang.GroovyClassLoader;
import org.codehaus.groovy.control.io.ReaderSource;
import java.io.File;
import java.net.URL;
public class SourceUnit {
public SourceUnit(String name, ReaderSource source, CompilerConfiguration flags,
GroovyClassLoader loader, ErrorCollector er) {}
public SourceUnit(File source, CompilerConfiguration configuration, GroovyClassLoader loader,
ErrorCollector er) {}
public SourceUnit(URL source, CompilerConfiguration configuration, GroovyClassLoader loader,
ErrorCollector er) {}
public SourceUnit(String name, String source, CompilerConfiguration configuration,
GroovyClassLoader loader, ErrorCollector er) {}
public String getName() {
return null;
}
public boolean failedWithUnexpectedEOF() {
return false;
}
public static SourceUnit create(String name, String source) {
return null;
}
public static SourceUnit create(String name, String source, int tolerance) {
return null;
}
public void parse() throws CompilationFailedException {}
public void convert() throws CompilationFailedException {}
public void addException(Exception e) throws CompilationFailedException {}
public ReaderSource getSource() {
return null;
}
public void setSource(ReaderSource source) {}
}

View File

@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control.io;
import org.codehaus.groovy.control.CompilerConfiguration;
public abstract class AbstractReaderSource implements ReaderSource {
public AbstractReaderSource(final CompilerConfiguration configuration) {}
public boolean canReopenSource() {
return false;
}
public void cleanup() {}
}

View File

@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control.io;
import java.io.IOException;
import java.io.Reader;
import java.net.URI;
public interface ReaderSource {
Reader getReader() throws IOException;
boolean canReopenSource();
void cleanup();
URI getURI();
}

View File

@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.codehaus.groovy.control.io;
import java.io.IOException;
import java.io.Reader;
import java.net.URI;
import org.codehaus.groovy.control.CompilerConfiguration;
public class StringReaderSource extends AbstractReaderSource {
public StringReaderSource(String string, CompilerConfiguration configuration) {
super(configuration);
}
public Reader getReader() throws IOException {
return null;
}
public URI getURI() {
return null;
}
}