C# Class Parser.TagBase

The base class for all the tags.
Exibir arquivo Open project: totpero/SqlParser Class Usage Examples

Public Methods

Method Description
GetTagMatchAttribute ( Type tag ) : MatchTagAttributeBase

Returns the match attribute of the specified class. This attribute is used to identify a tag in a text.

GetTagType ( Type tag ) : string

Returns the type of the specified tag (its identifier). This method is used by the Type property.

InitializeFromData ( ParserBase parser, string value, bool hasContents ) : void

Reads the tag from the specified data.

InitializeFromText ( ParserBase parser, string text, int position, TagBase parentTag ) : int

Reads the tag at the specified position in the specified word and separator array.

MatchEnd ( string text, int position ) : int

Returns a value indicating whether there is the tag ending at the specified position.

WriteEnd ( StringBuilder output ) : void

Writes the end of the tag.

WriteStart ( StringBuilder output ) : void

Writes the start of the tag.

Protected Methods

Method Description
CheckInitialized ( ) : void

Checks whether the tag is initialized, and throws an exception if not. This method should be called before a tag porperty or method is accessed.

InitializeCoreFromText ( ParserBase parser, string text, int position, TagBase parentTag ) : int

Reads the tag at the specified position in the specified word and separator array.

InitializeFromDataCore ( ParserBase parser, string value, bool hasContents ) : void

Reads the tag from the specified data.

Method Details

CheckInitialized() protected method

Checks whether the tag is initialized, and throws an exception if not. This method should be called before a tag porperty or method is accessed.
protected CheckInitialized ( ) : void
return void

GetTagMatchAttribute() public static method

Returns the match attribute of the specified class. This attribute is used to identify a tag in a text.
public static GetTagMatchAttribute ( Type tag ) : MatchTagAttributeBase
tag System.Type
return MatchTagAttributeBase

GetTagType() public static method

Returns the type of the specified tag (its identifier). This method is used by the Type property.
public static GetTagType ( Type tag ) : string
tag System.Type
return string

InitializeCoreFromText() protected abstract method

Reads the tag at the specified position in the specified word and separator array.
protected abstract InitializeCoreFromText ( ParserBase parser, string text, int position, TagBase parentTag ) : int
parser ParserBase
text string
position int
parentTag TagBase /// The parent tag of this tag. This argument is used to determine /// the end of the tag (it can be the end of the parent tag). ///
return int

InitializeFromData() public method

Reads the tag from the specified data.
public InitializeFromData ( ParserBase parser, string value, bool hasContents ) : void
parser ParserBase
value string
hasContents bool
return void

InitializeFromDataCore() protected method

Reads the tag from the specified data.
protected InitializeFromDataCore ( ParserBase parser, string value, bool hasContents ) : void
parser ParserBase
value string
hasContents bool
return void

InitializeFromText() public method

Reads the tag at the specified position in the specified word and separator array.
public InitializeFromText ( ParserBase parser, string text, int position, TagBase parentTag ) : int
parser ParserBase
text string
position int
parentTag TagBase /// The parent tag of this tag. This argument is used to determine /// the end of the tag (it can be the end of the parent tag). ///
return int

MatchEnd() public method

Returns a value indicating whether there is the tag ending at the specified position.
public MatchEnd ( string text, int position ) : int
text string
position int
return int

WriteEnd() public method

Writes the end of the tag.
public WriteEnd ( StringBuilder output ) : void
output StringBuilder
return void

WriteStart() public abstract method

Writes the start of the tag.
public abstract WriteStart ( StringBuilder output ) : void
output StringBuilder
return void