OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com.mapd.parser.extension.ddl.SqlAttributeDefinition Class Reference
+ Inheritance diagram for com.mapd.parser.extension.ddl.SqlAttributeDefinition:
+ Collaboration diagram for com.mapd.parser.extension.ddl.SqlAttributeDefinition:

Public Member Functions

SqlOperator getOperator ()
 
List< SqlNode > getOperandList ()
 
void unparse (SqlWriter writer, int leftPrec, int rightPrec)
 
String toString ()
 

Public Attributes

final SqlIdentifier name
 
final SqlDataTypeSpec dataType
 

Package Functions

 SqlAttributeDefinition (SqlParserPos pos, SqlIdentifier name, SqlDataTypeSpec dataType, SqlNode expression, SqlCollation collation)
 

Package Attributes

final SqlNode expression
 
final SqlCollation collation
 

Private Member Functions

void exp (SqlWriter writer)
 

Static Private Attributes

static final SqlSpecialOperator OPERATOR
 

Detailed Description

Parse tree for SqlAttributeDefinition, which is part of a SqlCreateType.

Definition at line 38 of file SqlAttributeDefinition.java.

Constructor & Destructor Documentation

com.mapd.parser.extension.ddl.SqlAttributeDefinition.SqlAttributeDefinition ( SqlParserPos  pos,
SqlIdentifier  name,
SqlDataTypeSpec  dataType,
SqlNode  expression,
SqlCollation  collation 
)
inlinepackage

Member Function Documentation

void com.mapd.parser.extension.ddl.SqlAttributeDefinition.exp ( SqlWriter  writer)
inlineprivate

Definition at line 88 of file SqlAttributeDefinition.java.

Referenced by com.mapd.parser.extension.ddl.SqlAttributeDefinition.unparse().

88  {
89  if (writer.isAlwaysUseParentheses()) {
90  expression.unparse(writer, 0, 0);
91  } else {
92  writer.sep("(");
93  expression.unparse(writer, 0, 0);
94  writer.sep(")");
95  }
96  }

+ Here is the caller graph for this function:

List<SqlNode> com.mapd.parser.extension.ddl.SqlAttributeDefinition.getOperandList ( )
inline
SqlOperator com.mapd.parser.extension.ddl.SqlAttributeDefinition.getOperator ( )
inline
String com.mapd.parser.extension.ddl.SqlAttributeDefinition.toString ( )
inline

Definition at line 99 of file SqlAttributeDefinition.java.

99  {
100  return "NULL";
101  }
void com.mapd.parser.extension.ddl.SqlAttributeDefinition.unparse ( SqlWriter  writer,
int  leftPrec,
int  rightPrec 
)
inline

Definition at line 71 of file SqlAttributeDefinition.java.

References com.mapd.parser.extension.ddl.SqlAttributeDefinition.collation, com.mapd.parser.extension.ddl.SqlAttributeDefinition.dataType, com.mapd.parser.extension.ddl.SqlAttributeDefinition.exp(), and com.mapd.parser.extension.ddl.SqlAttributeDefinition.expression.

71  {
72  name.unparse(writer, 0, 0);
73  dataType.unparse(writer, 0, 0);
74  if (collation != null) {
75  writer.keyword("COLLATE");
76  collation.unparse(writer);
77  }
78  if (dataType.getNullable() != null && !dataType.getNullable()) {
79  writer.keyword("NOT NULL");
80  }
81  if (expression != null) {
82  writer.keyword("DEFAULT");
83  exp(writer);
84  }
85  }

+ Here is the call graph for this function:

Member Data Documentation

final SqlCollation com.mapd.parser.extension.ddl.SqlAttributeDefinition.collation
package
final SqlNode com.mapd.parser.extension.ddl.SqlAttributeDefinition.expression
package
final SqlSpecialOperator com.mapd.parser.extension.ddl.SqlAttributeDefinition.OPERATOR
staticprivate
Initial value:
=
new SqlSpecialOperator("ATTRIBUTE_DEF", SqlKind.ATTRIBUTE_DEF)

Definition at line 39 of file SqlAttributeDefinition.java.

Referenced by com.mapd.parser.extension.ddl.SqlAttributeDefinition.getOperator().


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