builtin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMetafileName = "sobjects.json"

Variables

View Source
var BooleanType = &ClassType{
	Name: "Boolean",
	ToString: func(o *Object) string {
		return fmt.Sprintf("%t", o.Value().(bool))
	},
}
View Source
var DatabaseDriver = NewDatabaseDriver()
View Source
var DoubleType = &ClassType{
	Name: "Double",
	ToString: func(o *Object) string {
		return fmt.Sprintf("%f", o.Value().(float64))
	},
}
View Source
var ExceptionType = createExceptionType()
View Source
var IntegerType = &ClassType{
	Name: "Integer",
	ToString: func(o *Object) string {
		return fmt.Sprintf("%d", o.Value().(int))
	},
}
View Source
var ListType = createListType()
View Source
var MapType = createMapType()
View Source
var Null = &Object{
	ClassType:      NullType,
	InstanceFields: NewObjectMap(),
	GenericType:    []*ClassType{},
	Extra:          map[string]interface{}{},
}
View Source
var NullType = &ClassType{
	Name:     "null",
	ToString: func(o *Object) string { return "null" },
}
View Source
var ObjectType = CreateClass(
	"Object",
	[]*Method{},
	nil,
	nil,
)
View Source
var PrimitiveClasses []*ClassType

Functions

func CreateListTypeParameter added in v0.1.1

func CreateListTypeParameter(typeRef *ast.TypeRef) *ast.Parameter

func CreateListTypeRef added in v0.1.1

func CreateListTypeRef(typeRef *ast.TypeRef) *ast.TypeRef

func CreateMetadataFile added in v0.1.1

func CreateMetadataFile(filename string) error

func Load added in v0.1.1

func Load(src string)

func NewDatabaseDriver added in v0.1.1

func NewDatabaseDriver() *databaseDriver

func NewSoapClient added in v0.1.1

func NewSoapClient() *soapforce.Client

func PublicModifier added in v0.1.1

func PublicModifier() *ast.Modifier

func Seed added in v0.1.1

func Seed()

func Setup added in v0.1.1

func Setup()

func String

func String(o *Object) string

func TypeName

func TypeName(v interface{}) string

Types

type ClassMap

type ClassMap struct {
	Data map[string]*ClassType
}

*

  • ClassMap

func NewClassMap

func NewClassMap() *ClassMap

func NewClassMapWithPrimivie

func NewClassMapWithPrimivie(classTypes []*ClassType) *ClassMap

func PrimitiveClassMap

func PrimitiveClassMap() *ClassMap

func (*ClassMap) Clear

func (m *ClassMap) Clear()

func (*ClassMap) Get

func (m *ClassMap) Get(k string) (*ClassType, bool)

func (*ClassMap) Set

func (m *ClassMap) Set(k string, n *ClassType)

type ClassType

type ClassType struct {
	Annotations        []ast.Node
	Modifiers          []ast.Node
	Name               string
	SuperClassRef      ast.Node
	SuperClass         *ClassType
	ImplementClasses   []*ClassType
	ImplementClassRefs []ast.Node
	Constructors       []*Method
	InstanceFields     *FieldMap
	StaticFields       *FieldMap
	InstanceMethods    *MethodMap
	StaticMethods      *MethodMap
	InnerClasses       *ClassMap
	ToString           func(*Object) string
	Extra              map[string]interface{}
	Interface          bool
	Location           *ast.Location
	Parent             ast.Node
}
var StringType *ClassType

func CreateClass added in v0.1.1

func CreateClass(
	name string,
	constructors []*Method,
	instanceMethods *MethodMap,
	staticMethods *MethodMap,
) *ClassType

func (*ClassType) Equals

func (t *ClassType) Equals(other *ClassType) bool

func (*ClassType) IsGeneric

func (t *ClassType) IsGeneric() bool

func (*ClassType) IsInterface added in v0.1.1

func (t *ClassType) IsInterface() bool

func (*ClassType) IsPrimitive

func (t *ClassType) IsPrimitive() bool

func (*ClassType) String

func (t *ClassType) String() string

type Field

type Field struct {
	Type       ast.Node
	Modifiers  []ast.Node
	Name       string
	Expression ast.Node
	Getter     ast.Node
	Setter     ast.Node
	Location   *ast.Location
	Parent     ast.Node
}

func CreateField added in v0.1.1

func CreateField(
	name string,
	fieldType *ast.TypeRef,
) *Field

func (*Field) AccessModifier

func (f *Field) AccessModifier(checkSetter bool) string

func (*Field) Is

func (f *Field) Is(name string) bool

func (*Field) IsAbstract

func (f *Field) IsAbstract() bool

func (*Field) IsAccessor added in v0.1.1

func (f *Field) IsAccessor(modifier string, checkSetter bool) bool

func (*Field) IsOverride

func (f *Field) IsOverride() bool

func (*Field) IsPrivate

func (f *Field) IsPrivate(checkSetter bool) bool

func (*Field) IsProtected

func (f *Field) IsProtected(checkSetter bool) bool

func (*Field) IsPublic

func (f *Field) IsPublic(checkSetter bool) bool

func (*Field) IsVirtual

func (f *Field) IsVirtual() bool

type FieldMap

type FieldMap struct {
	Data map[string]*Field
}

func NewFieldMap

func NewFieldMap() *FieldMap

func (*FieldMap) Get

func (m *FieldMap) Get(k string) (*Field, bool)

func (*FieldMap) Set

func (m *FieldMap) Set(k string, n *Field)

type Loader added in v0.1.1

type Loader interface {
	Load() (map[string]Sobject, error)
}

type MetaFileLoader added in v0.1.1

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

func (*MetaFileLoader) Load added in v0.1.1

func (m *MetaFileLoader) Load() (map[string]Sobject, error)

type Method added in v0.1.1

type Method struct {
	Name        string
	Annotations []ast.Node
	Modifiers   []ast.Node
	ReturnType  ast.Node
	Parameters  []ast.Node
	Throws      []ast.Node
	Statements  ast.Node
	// func(receiver, value, options)
	NativeFunction func(*Object, []*Object, map[string]interface{}) interface{}
	Location       *ast.Location
	Parent         ast.Node
}

func CreateMethod added in v0.1.1

func CreateMethod(
	name string,
	returnType ast.Node,
	parameters []ast.Node,
	nativeFunction func(*Object, []*Object, map[string]interface{}) interface{},
) *Method

func NewConstructor added in v0.1.1

func NewConstructor(decl *ast.ConstructorDeclaration) *Method

func NewMethod added in v0.1.1

func NewMethod(decl *ast.MethodDeclaration) *Method

func (*Method) AccessModifier added in v0.1.1

func (m *Method) AccessModifier() string

func (*Method) Is added in v0.1.1

func (m *Method) Is(name string) bool

func (*Method) IsAbstract added in v0.1.1

func (m *Method) IsAbstract() bool

func (*Method) IsAnnotated added in v0.1.1

func (m *Method) IsAnnotated(name string) bool

func (*Method) IsOverride added in v0.1.1

func (m *Method) IsOverride() bool

func (*Method) IsPrivate added in v0.1.1

func (m *Method) IsPrivate() bool

func (*Method) IsProtected added in v0.1.1

func (m *Method) IsProtected() bool

func (*Method) IsPublic added in v0.1.1

func (m *Method) IsPublic() bool

func (*Method) IsTestMethod added in v0.1.1

func (m *Method) IsTestMethod() bool

func (*Method) IsVirtual added in v0.1.1

func (m *Method) IsVirtual() bool

type MethodMap

type MethodMap struct {
	Data map[string][]*Method
}

func NewMethodMap

func NewMethodMap() *MethodMap

func (*MethodMap) Add

func (m *MethodMap) Add(k string, n *Method)

func (*MethodMap) All

func (m *MethodMap) All() [][]*Method

func (*MethodMap) Get

func (m *MethodMap) Get(k string) ([]*Method, bool)

func (*MethodMap) Set

func (m *MethodMap) Set(k string, n []*Method)

type NameSpaceStore

type NameSpaceStore struct {
	Data map[string]*ClassMap
}

*

  • NameSpaces

func GetNameSpaceStore added in v0.1.1

func GetNameSpaceStore() *NameSpaceStore

func NewNameSpaceStore

func NewNameSpaceStore() *NameSpaceStore

func (*NameSpaceStore) Add

func (m *NameSpaceStore) Add(k string, n *ClassType)

func (*NameSpaceStore) Get

func (m *NameSpaceStore) Get(k string) (*ClassMap, bool)

func (*NameSpaceStore) Set

func (m *NameSpaceStore) Set(k string, n *ClassMap)

type Object

type Object struct {
	ClassType      *ClassType
	InstanceFields *ObjectMap
	GenericType    []*ClassType
	Extra          map[string]interface{}
}

func CreateListObject added in v0.1.1

func CreateListObject(classType *ClassType, records []*Object) *Object

func CreateObject

func CreateObject(t *ClassType) *Object

func NewBoolean added in v0.1.1

func NewBoolean(value bool) *Object

func NewDouble added in v0.1.1

func NewDouble(value float64) *Object

func NewInteger added in v0.1.1

func NewInteger(value int) *Object

func NewString added in v0.1.1

func NewString(value string) *Object

func (*Object) BoolValue

func (o *Object) BoolValue() bool

func (*Object) DoubleValue

func (o *Object) DoubleValue() float64

func (*Object) IntegerValue

func (o *Object) IntegerValue() int

func (*Object) StringValue

func (o *Object) StringValue() string

func (*Object) Value

func (o *Object) Value() interface{}

type ObjectMap

type ObjectMap struct {
	Data map[string]*Object
}

*

  • ObjectMap

func NewObjectMap

func NewObjectMap() *ObjectMap

func (*ObjectMap) All

func (m *ObjectMap) All() map[string]*Object

func (*ObjectMap) Get

func (m *ObjectMap) Get(k string) (*Object, bool)

func (*ObjectMap) Set

func (m *ObjectMap) Set(k string, n *Object)

type Relation added in v0.1.1

type Relation struct {
	RelationshipName string
	FieldName        string
	ReferenceTo      string
}

type Sobject added in v0.1.1

type Sobject struct {
	Name          string
	Custom        bool
	CustomSetting bool
	Label         string
	Fields        []SobjectField
}

type SobjectField added in v0.1.1

type SobjectField struct {
	Name             string
	Type             string
	Label            string
	RelationshipName string
	Custom           bool
	ReferenceTo      []string
}

type SqlBuilder added in v0.1.1

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

func (*SqlBuilder) Build added in v0.1.1

func (b *SqlBuilder) Build(n *ast.Soql) (string, [][]string, map[string]Relation)

type ToStringer

type ToStringer struct {
	Indent int
}

func (*ToStringer) AddIndent

func (v *ToStringer) AddIndent(f func())

func (*ToStringer) String

func (v *ToStringer) String(o *Object) string

type TypeRefResolver added in v0.1.1

type TypeRefResolver struct {
	NameSpaces   *NameSpaceStore
	ClassTypes   *ClassMap
	CurrentClass *ClassType
}

func (*TypeRefResolver) ConvertType added in v0.1.1

func (r *TypeRefResolver) ConvertType(n *ast.TypeRef) (*ClassType, error)

func (*TypeRefResolver) ResolveType added in v0.1.1

func (r *TypeRefResolver) ResolveType(names []string) (*ClassType, error)

Jump to

Keyboard shortcuts

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