Documentation
¶
Index ¶
- Variables
- func IsBuiltin(name string) bool
- func Validate(doc *parser.Document, lookupType func(qualifiedName string) bool) []error
- type ArrayType
- type BinderType
- type EnumType
- type FileDescriptorType
- type InterfaceType
- type ListType
- type MapType
- type NullableType
- type ParcelableType
- type PrimitiveType
- type ResolvedType
- type StringType
- type UnionType
- type ValidationError
- type VoidType
Constants ¶
This section is empty.
Variables ¶
var BuiltinTypes = map[string]ResolvedType{ "void": &VoidType{}, "boolean": &PrimitiveType{Name: "boolean"}, "byte": &PrimitiveType{Name: "byte"}, "char": &PrimitiveType{Name: "char"}, "int": &PrimitiveType{Name: "int"}, "long": &PrimitiveType{Name: "long"}, "float": &PrimitiveType{Name: "float"}, "double": &PrimitiveType{Name: "double"}, "String": &StringType{}, "IBinder": &BinderType{}, "ParcelFileDescriptor": &FileDescriptorType{}, }
BuiltinTypes maps AIDL built-in type names to their ResolvedType.
Functions ¶
func Validate ¶
Validate performs semantic validation on a parsed document. It checks that:
- All type references can be resolved (are built-in or found by lookupType)
- Parameter directions are valid (in/out/inout on interface methods)
- Oneway methods return void and have only 'in' parameters
- Enum backing types are valid primitives
Types ¶
type BinderType ¶
type BinderType struct{}
BinderType represents IBinder.
func (*BinderType) String ¶
func (t *BinderType) String() string
type EnumType ¶
type EnumType struct {
QualifiedName string
}
EnumType represents a reference to an AIDL enum.
type FileDescriptorType ¶
type FileDescriptorType struct{}
FileDescriptorType represents ParcelFileDescriptor.
func (*FileDescriptorType) String ¶
func (t *FileDescriptorType) String() string
type InterfaceType ¶
type InterfaceType struct {
QualifiedName string
}
InterfaceType represents a reference to an AIDL interface.
func (*InterfaceType) String ¶
func (t *InterfaceType) String() string
type MapType ¶
type MapType struct {
KeyType ResolvedType
ValueType ResolvedType
}
MapType represents Map<K,V>.
type NullableType ¶
type NullableType struct {
Inner ResolvedType
}
NullableType wraps a type to indicate @nullable.
func (*NullableType) String ¶
func (t *NullableType) String() string
type ParcelableType ¶
type ParcelableType struct {
QualifiedName string
}
ParcelableType represents a reference to an AIDL parcelable.
func (*ParcelableType) String ¶
func (t *ParcelableType) String() string
type PrimitiveType ¶
type PrimitiveType struct {
Name string
}
PrimitiveType represents a built-in primitive (int, long, float, double, boolean, byte, char).
func (*PrimitiveType) String ¶
func (t *PrimitiveType) String() string
type ResolvedType ¶
type ResolvedType interface {
String() string
// contains filtered or unexported methods
}
ResolvedType represents a fully resolved AIDL type.
type StringType ¶
type StringType struct {
UTF8 bool // true if @utf8InCpp annotated
}
StringType represents the AIDL String type (UTF-16 or UTF-8).
func (*StringType) String ¶
func (t *StringType) String() string
type UnionType ¶
type UnionType struct {
QualifiedName string
}
UnionType represents a reference to an AIDL union.
type ValidationError ¶
ValidationError represents a semantic validation error.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap returns nil — ValidationError is a leaf error with no wrapped cause.