C# Класс CK.Text.JSONVisitor

Small JSON visitor.
Показать файл Открыть проект

Открытые методы

Метод Описание
JSONVisitor ( StringMatcher m ) : System

Initializes a new JSONVisitor bound to a Matcher.

JSONVisitor ( string s ) : System

Initializes a new JSONVisitor on a string. A Matcher is automatically created.

Visit ( ) : bool

Visits any json item: it is either a terminal (VisitTerminalValue), {"an":"object"} (see VisitObjectContent or ["an","array"] (see VisitArrayContent).

VisitArrayContent ( ) : bool

Visits a comma seprarated list of json items until a closing ']' is found.

VisitObjectContent ( ) : bool

Visits a comma seprarated list of "property" : ... fields until a closing } is found or Matcher.IsEnd becomes true.

Защищенные методы

Метод Описание
SkipWhiteSpaces ( ) : void

Skips white spaces: simply calls StringMatcher.MatchWhiteSpaces(int) with 0 minimal count of spaces.

VisitArrayCell ( int cellNumber ) : bool

Visits a cell in a Parent array.

VisitObjectProperty ( int startPropertyIndex, string propertyName, int propertyNumber ) : bool

Visits a "property" : ... JSON property.

VisitTerminalValue ( ) : bool

Visits a terminal value. This method simply calls Matcher.MatchWhiteSpaces(0) to skip any whitespace and TryMatchJSONTerminalValue to skip the value itself.

Описание методов

JSONVisitor() публичный Метод

Initializes a new JSONVisitor bound to a Matcher.
public JSONVisitor ( StringMatcher m ) : System
m StringMatcher The string matcher.
Результат System

JSONVisitor() публичный Метод

Initializes a new JSONVisitor on a string. A Matcher is automatically created.
public JSONVisitor ( string s ) : System
s string The string to parse.
Результат System

SkipWhiteSpaces() защищенный Метод

Skips white spaces: simply calls StringMatcher.MatchWhiteSpaces(int) with 0 minimal count of spaces.
protected SkipWhiteSpaces ( ) : void
Результат void

Visit() публичный Метод

Visits any json item: it is either a terminal (VisitTerminalValue), {"an":"object"} (see VisitObjectContent or ["an","array"] (see VisitArrayContent).
public Visit ( ) : bool
Результат bool

VisitArrayCell() защищенный Метод

Visits a cell in a Parent array.
protected VisitArrayCell ( int cellNumber ) : bool
cellNumber int Zero based cell nummber.
Результат bool

VisitArrayContent() публичный Метод

Visits a comma seprarated list of json items until a closing ']' is found.
public VisitArrayContent ( ) : bool
Результат bool

VisitObjectContent() публичный Метод

Visits a comma seprarated list of "property" : ... fields until a closing } is found or Matcher.IsEnd becomes true.
public VisitObjectContent ( ) : bool
Результат bool

VisitObjectProperty() защищенный Метод

Visits a "property" : ... JSON property.
protected VisitObjectProperty ( int startPropertyIndex, string propertyName, int propertyNumber ) : bool
startPropertyIndex int /// Starting index of the in : /// this is the index of the opening quote ". ///
propertyName string Parsed property name.
propertyNumber int Zero based number of the property in the object.
Результат bool

VisitTerminalValue() защищенный Метод

Visits a terminal value. This method simply calls Matcher.MatchWhiteSpaces(0) to skip any whitespace and TryMatchJSONTerminalValue to skip the value itself.
protected VisitTerminalValue ( ) : bool
Результат bool