Show / Hide Table of Contents

Class Schema

Base class for all schema types

Inheritance
System.Object
Schema
NamedSchema
UnnamedSchema
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Avro
Assembly: Avro.dll
Syntax
public abstract class Schema

Constructors

| Improve this Doc View Source

Schema(Schema.Type, PropertyMap)

Constructor for schema class

Declaration
protected Schema(Schema.Type type, PropertyMap props)
Parameters
Type Name Description
Schema.Type type
PropertyMap props

Properties

| Improve this Doc View Source

Name

The name of this schema. If this is a named schema such as an enum, it returns the fully qualified name for the schema. For other schemas, it returns the type of the schema.

Declaration
public abstract string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Tag

Schema type property

Declaration
public Schema.Type Tag { get; }
Property Value
Type Description
Schema.Type

Methods

| Improve this Doc View Source

areEqual(Object, Object)

Compares two objects, null is equal to null

Declaration
protected static bool areEqual(object o1, object o2)
Parameters
Type Name Description
System.Object o1

first object

System.Object o2

second object

Returns
Type Description
System.Boolean

true if two objects are equal, false otherwise

| Improve this Doc View Source

CanRead(Schema)

Returns true if and only if data written using writerSchema can be read using the current schema according to the Avro resolution rules.

Declaration
public virtual bool CanRead(Schema writerSchema)
Parameters
Type Name Description
Schema writerSchema

The writer's schema to match against.

Returns
Type Description
System.Boolean

True if and only if the current schema matches the writer's.

| Improve this Doc View Source

GetHashCode()

Hash code function

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

getHashCode(Object)

Hash code helper function

Declaration
protected static int getHashCode(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetProperty(String)

Returns the schema's custom property value given the property name

Declaration
public string GetProperty(string key)
Parameters
Type Name Description
System.String key

custom property name

Returns
Type Description
System.String

custom property value

| Improve this Doc View Source

GetTypeString(Schema.Type)

Returns symbol name for the given schema type

Declaration
public static string GetTypeString(Schema.Type type)
Parameters
Type Name Description
Schema.Type type

schema type

Returns
Type Description
System.String

symbol name

| Improve this Doc View Source

Parse(String)

Parses a given JSON string to create a new schema object

Declaration
public static Schema Parse(string json)
Parameters
Type Name Description
System.String json

JSON string

Returns
Type Description
Schema

new Schema object

| Improve this Doc View Source

ToString()

Returns the canonical JSON representation of this schema.

Declaration
public override string ToString()
Returns
Type Description
System.String

The canonical JSON representation of this schema.

Overrides
System.Object.ToString()
| Improve this Doc View Source

WriteJson(JsonTextWriter, SchemaNames, String)

Writes schema object in JSON format

Declaration
protected virtual void WriteJson(JsonTextWriter writer, SchemaNames names, string encspace)
Parameters
Type Name Description
Newtonsoft.Json.JsonTextWriter writer

JSON writer

SchemaNames names

list of named schemas already written

System.String encspace

enclosing namespace of the schema

| Improve this Doc View Source

WriteJsonFields(JsonTextWriter, SchemaNames, String)

Default implementation for writing schema properties in JSON format

Declaration
protected virtual void WriteJsonFields(JsonTextWriter writer, SchemaNames names, string encspace)
Parameters
Type Name Description
Newtonsoft.Json.JsonTextWriter writer

JSON writer

SchemaNames names

list of named schemas already written

System.String encspace

enclosing namespace of the schema

  • Improve this Doc
  • View Source
Back to top Copyright © 2012 The Apache Software Foundation.