DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Protected Member Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Parser.GrantRoleStatementNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.GrantRoleStatementNode:
Deveel.Data.Sql.Parser.SqlStatementNode Deveel.Data.Sql.Parser.SqlNode Deveel.Data.Sql.Parser.ISqlVisitableNode Deveel.Data.Sql.Parser.IStatementNode Deveel.Data.Sql.Parser.ISqlNode Deveel.Data.Sql.Parser.ISqlNode Deveel.Data.Sql.Parser.ISqlNode

Protected Member Functions

override ISqlNode OnChildNode (ISqlNode node)
 During the initialization of the node from the parser, this method is called for every child node added to ChildNodes More...
 
override void BuildStatement (StatementBuilder builder)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Parser.SqlNode
virtual void OnNodeInit ()
 After the initialization of the node from the parser, this method is invoked to let the specific initialization to occur. More...
 

Properties

IEnumerable< string > Grantees [get, private set]
 
IEnumerable< string > Roles [get, private set]
 
bool WithAdmin [get, private set]
 
- Properties inherited from Deveel.Data.Sql.Parser.SqlNode
ISqlNode Parent [get, private set]
 Gets the parent of the current node. More...
 
string NodeName [get, private set]
 Gets the name of the node, as expressed in the SQL grammar. More...
 
IEnumerable< ISqlNodeChildNodes [get, private set]
 Gets an immutable list of nodes, children of the current node. More...
 
IEnumerable< TokenTokens [get, private set]
 Gets an immutable list of Token that represent the source of this node. More...
 
string ISqlNode. NodeName [get]
 
ISqlNode ISqlNode. Parent [get]
 
IEnumerable< ISqlNode > ISqlNode. ChildNodes [get]
 
IEnumerable< Token > ISqlNode. Tokens [get]
 
- Properties inherited from Deveel.Data.Sql.Parser.ISqlNode
string NodeName [get]
 Gets the name of the node analyzed from the parser. More...
 
ISqlNode Parent [get]
 Gets a reference to the parent ISqlNode, if any. More...
 
IEnumerable< ISqlNodeChildNodes [get]
 Gets a read-only enumeration of the children nodes, if any. More...
 
IEnumerable< TokenTokens [get]
 Gets an enumeration of the tokens composing the this node. More...
 

Private Member Functions

void GetGrantees (ISqlNode node)
 
void GetRoleList (ISqlNode node)
 
void GetWithAdmin (ISqlNode node)
 

Additional Inherited Members

- Public Member Functions inherited from Deveel.Data.Sql.Parser.SqlNode
 SqlNode ()
 

Detailed Description

Definition at line 24 of file GrantRoleStatementNode.cs.

Member Function Documentation

override void Deveel.Data.Sql.Parser.GrantRoleStatementNode.BuildStatement ( StatementBuilder  builder)
inlineprotectedvirtual

Implements Deveel.Data.Sql.Parser.SqlStatementNode.

Definition at line 56 of file GrantRoleStatementNode.cs.

56  {
57  foreach (var grantee in Grantees) {
58  foreach (var role in Roles) {
59  builder.Statements.Add(new GrantRoleStatement(grantee, role, WithAdmin));
60  }
61  }
62  }
void Deveel.Data.Sql.Parser.GrantRoleStatementNode.GetGrantees ( ISqlNode  node)
inlineprivate

Definition at line 43 of file GrantRoleStatementNode.cs.

43  {
44  Grantees = node.ChildNodes.OfType<IdentifierNode>().Select(x => x.Text);
45  }
void Deveel.Data.Sql.Parser.GrantRoleStatementNode.GetRoleList ( ISqlNode  node)
inlineprivate

Definition at line 47 of file GrantRoleStatementNode.cs.

47  {
48  Roles = node.ChildNodes.OfType<IdentifierNode>().Select(x => x.Text);
49  }
void Deveel.Data.Sql.Parser.GrantRoleStatementNode.GetWithAdmin ( ISqlNode  node)
inlineprivate

Definition at line 51 of file GrantRoleStatementNode.cs.

51  {
52  if (node.ChildNodes.Any())
53  WithAdmin = true;
54  }
override ISqlNode Deveel.Data.Sql.Parser.GrantRoleStatementNode.OnChildNode ( ISqlNode  node)
inlineprotectedvirtual

During the initialization of the node from the parser, this method is called for every child node added to ChildNodes

Parameters
nodeThe node being added to the list of children.
Returns
Returns a normalized version of the child node, or the node itself.

Reimplemented from Deveel.Data.Sql.Parser.SqlNode.

Definition at line 31 of file GrantRoleStatementNode.cs.

31  {
32  if (node.NodeName.Equals("role_list")) {
33  GetRoleList(node);
34  } else if (node.NodeName.Equals("distribution_list")) {
35  GetGrantees(node);
36  } else if (node.NodeName.Equals("with_admin_opt")) {
37  GetWithAdmin(node);
38  }
39 
40  return base.OnChildNode(node);
41  }

Property Documentation

IEnumerable<string> Deveel.Data.Sql.Parser.GrantRoleStatementNode.Grantees
getprivate set

Definition at line 25 of file GrantRoleStatementNode.cs.

IEnumerable<string> Deveel.Data.Sql.Parser.GrantRoleStatementNode.Roles
getprivate set

Definition at line 27 of file GrantRoleStatementNode.cs.

bool Deveel.Data.Sql.Parser.GrantRoleStatementNode.WithAdmin
getprivate set

Definition at line 29 of file GrantRoleStatementNode.cs.


The documentation for this class was generated from the following file: