/** * Returns the primitive type if <code>this</code> represents a dot * expressions of type <code>PRIMITIVE_TYPE_DOT_CLASS</code>. * * @see #getLeftExpression() * * @return The primitive type if <code>this</code> represents a dot * expressions of type <code>PRIMITIVE_TYPE_DOT_CLASS</code> and * <code>null</code> otherwise. */ public PrimitiveType getPrimitiveTypeFromLeft() { if (mDotExprType != DotExprType.PRIMITIVE_TYPE_DOT_CLASS) { return null; // Nothing to return if 'this' is not 'DOTEXPR_TYPE_2' } if (mPrimitiveType == null) { mPrimitiveType = new AST2PrimitiveType((AST2JSOMTree) getTreeNode().GetChild(0), getTokenRewriteStream()); } return mPrimitiveType; }
/** * If <code>this</code> represents a primitive type this method returns the * appropriate <code>PrimitiveType</code> object, Otherwise, i.e. if <code> * isComplexType()</code> returns <code>true</code>, <code>null</code> will * be returned. * * @return A <code>PrimitiveType</code> object or <code>null</code> if * <code>this</code> represents a complex type. */ public PrimitiveType getPrimitiveType() { if (mIsComplexType) { return null; } if (mPrimitiveType == null) { mPrimitiveType = new AST2PrimitiveType((AST2JSOMTree) getTreeNode().GetChild(0), getTokenRewriteStream()); } return mPrimitiveType; }