1 28 29 package com.caucho.es; 30 31 public class ESNull extends ESBase { 32 ESNull() 33 { 34 prototype = ESBase.esBase; 35 className = "null"; 36 } 37 38 public ESBase typeof() throws ESException 39 { 40 return ESString.create("object"); 41 } 42 43 public Class getJavaType() 44 { 45 return Object .class; 46 } 47 48 public ESBase getProperty(ESString key) throws ESException 49 { 50 throw new ESNullException(className + " has no properties"); 51 } 52 53 public void setProperty(ESString key, ESBase value) throws ESException 54 { 55 throw new ESNullException(className + " has no properties"); 56 } 57 58 public double toNum() throws ESException 59 { 60 return 0; 61 } 62 63 public ESString toStr() throws ESException 64 { 65 return ESString.create("null"); 66 } 67 68 public String toJavaString() throws ESException 69 { 70 return null; 71 } 72 73 public boolean ecmaEquals(ESBase b) 74 { 75 return this == b || b == esUndefined; 76 } 77 } 78 | Popular Tags |