Package com.alibaba.druid.sql.ast.expr
Class SQLCastExpr
- java.lang.Object
-
- com.alibaba.druid.sql.ast.SQLObjectImpl
-
- com.alibaba.druid.sql.ast.SQLExprImpl
-
- com.alibaba.druid.sql.ast.expr.SQLCastExpr
-
- All Implemented Interfaces:
SQLExpr,SQLObject,SQLObjectWithDataType,SQLReplaceable,Cloneable
- Direct Known Subclasses:
PGTypeCastExpr
public class SQLCastExpr extends SQLExprImpl implements SQLObjectWithDataType, SQLReplaceable
-
-
Field Summary
Fields Modifier and Type Field Description protected SQLDataTypedataTypeprotected SQLExprexprprotected SQLExprformatprotected booleanisTry-
Fields inherited from class com.alibaba.druid.sql.ast.SQLExprImpl
parenthesized, parenthesizedCount
-
Fields inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
attributes, hint, parent, sourceColumn, sourceLine
-
-
Constructor Summary
Constructors Constructor Description SQLCastExpr()SQLCastExpr(SQLExpr expr, SQLDataType dataType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaccept0(SQLASTVisitor visitor)SQLCastExprclone()SQLDataTypecomputeDataType()longdateTypeHashCode()booleanequals(Object o)ListgetChildren()SQLDataTypegetDataType()SQLExprgetExpr()SQLExprgetFormat()inthashCode()booleanisTry()booleanreplace(SQLExpr expr, SQLExpr target)voidsetDataType(SQLDataType dataType)voidsetExpr(SQLExpr expr)voidsetFormat(SQLExpr format)voidsetTry(boolean aTry)StringtoString()-
Methods inherited from class com.alibaba.druid.sql.ast.SQLExprImpl
cloneTo, getParenthesizedCount, increaseParenthesizedCount, isParenthesized, setParenthesized, setParenthesizedCount
-
Methods inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
accept, acceptChild, acceptChild, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, cloneTo, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getHint, getParent, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, output, putAttribute, setHint, setParent, setSource, setSourceLine
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.alibaba.druid.sql.ast.SQLObject
accept, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getParent, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, output, putAttribute, setParent, setSource
-
-
-
-
Field Detail
-
isTry
protected boolean isTry
-
expr
protected SQLExpr expr
-
dataType
protected SQLDataType dataType
-
format
protected SQLExpr format
-
-
Constructor Detail
-
SQLCastExpr
public SQLCastExpr()
-
SQLCastExpr
public SQLCastExpr(SQLExpr expr, SQLDataType dataType)
-
-
Method Detail
-
getExpr
public SQLExpr getExpr()
-
setExpr
public void setExpr(SQLExpr expr)
-
getFormat
public SQLExpr getFormat()
-
setFormat
public void setFormat(SQLExpr format)
-
getDataType
public SQLDataType getDataType()
- Specified by:
getDataTypein interfaceSQLObjectWithDataType
-
dateTypeHashCode
public long dateTypeHashCode()
-
setDataType
public void setDataType(SQLDataType dataType)
- Specified by:
setDataTypein interfaceSQLObjectWithDataType
-
accept0
protected void accept0(SQLASTVisitor visitor)
- Specified by:
accept0in classSQLObjectImpl
-
getChildren
public List getChildren()
- Specified by:
getChildrenin interfaceSQLExpr- Overrides:
getChildrenin classSQLExprImpl
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classSQLExprImpl
-
hashCode
public int hashCode()
- Specified by:
hashCodein classSQLExprImpl
-
computeDataType
public SQLDataType computeDataType()
- Specified by:
computeDataTypein interfaceSQLExpr- Overrides:
computeDataTypein classSQLExprImpl
-
clone
public SQLCastExpr clone()
-
replace
public boolean replace(SQLExpr expr, SQLExpr target)
- Specified by:
replacein interfaceSQLReplaceable
-
isTry
public boolean isTry()
-
setTry
public void setTry(boolean aTry)
-
toString
public String toString()
- Overrides:
toStringin classSQLObjectImpl
-
-