javac

package
v0.0.0-...-d4285bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2014 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package javac is the OpenJDK Java compiler's implementation of an Impendulo tool. For more information see http://openjdk.java.net/groups/compiler/.

Index

Constants

View Source
const (
	NAME = "Javac"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	Id bson.ObjectId `bson:"_id"`
	//Type stores the type of result:
	//Success, Warnings or Errors.
	Type result.CompileType `bson:"type"`
	//Count is the number of errors or warnings encountered.
	Count int `bson:"count"`
	//Data is what was generated by compilation.
	Data []byte `bson:"data"`
}

Report contains the result of a Java compilation.

func NewReport

func NewReport(id bson.ObjectId, data []byte) *Report

NewReport

func (*Report) Errors

func (r *Report) Errors() bool

Errors tells us if there were errors during compilation.

func (*Report) Header

func (r *Report) Header() string

Header generates a string which briefly describes the compilation.

func (*Report) Success

func (r *Report) Success() bool

Success tells us if compilation finished with no errors or warnings.

func (*Report) Warnings

func (r *Report) Warnings() bool

Warnings tells us if there were warnings during compilation.

type Result

type Result struct {
	Id     bson.ObjectId `bson:"_id"`
	FileId bson.ObjectId `bson:"fileid"`
	Name   string        `bson:"name"`
	Report *Report       `bson:"report"`
	GridFS bool          `bson:"gridfs"`
	Type   string        `bson:"type"`
}

func NewResult

func NewResult(fileId bson.ObjectId, data []byte) *Result

NewResult

func (*Result) ChartVals

func (r *Result) ChartVals() []*result.ChartVal

ChartVals

func (*Result) GetFileId

func (r *Result) GetFileId() bson.ObjectId

GetFileId

func (*Result) GetId

func (r *Result) GetId() bson.ObjectId

GetId

func (*Result) GetName

func (r *Result) GetName() string

GetName

func (*Result) GetTestId

func (r *Result) GetTestId() bson.ObjectId

func (*Result) GetType

func (r *Result) GetType() string

func (*Result) OnGridFS

func (r *Result) OnGridFS() bool

OnGridFS

func (*Result) Reporter

func (r *Result) Reporter() result.Reporter

func (*Result) SetReport

func (r *Result) SetReport(report result.Reporter)

SetReport is used to change r result's report. R comes in handy when putting data into/getting data out of GridFS

func (*Result) Template

func (r *Result) Template() string

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

func New

func New(cp string) (*Tool, error)

New creates a new javac instance. cp is the classpath used when compiling.

func (*Tool) AddCP

func (t *Tool) AddCP(s string)

func (*Tool) Lang

func (t *Tool) Lang() tool.Language

Lang is Java.

func (*Tool) Name

func (t *Tool) Name() string

Name is Javac

func (*Tool) Run

func (t *Tool) Run(fileId bson.ObjectId, target *tool.Target) (result.Tooler, error)

Run compiles the Java source file specified by t. We compile with maximum warnings and compile classes implicitly loaded by the source code. All compilation results will be stored (success, errors and warnings).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL