Enum BMValueType



  • public enum BMValueType
    extends java.lang.Enum<BMValueType>
    BM Object/Array value type
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BM_ARRAY
      to initialize another WffBMArray
      BM_BYTE_ARRAY
      to initialize binary data.
      BM_OBJECT
      to initialize another WffBMObject
      BOOLEAN
      to initialize boolean value
      FUNCTION
      to initialize function, eg: function(arg) {alert(arg);}
      INTERNAL_BYTE
      Only for internal use not for development purpose.
      NULL
      to initialize null value
      NUMBER
      It can be int, float, long, double or any 64 bit floating point number
      REG_EXP
      to initialize reg expression
      STRING
      to initialize String value
      UNDEFINED
      to assign unidentified in JavaScript value, the value can be null for this data type.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static BMValueType getInstanceByType​(byte type)  
      byte getType​()  
      static BMValueType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static BMValueType[] values​()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • STRING

        public static final BMValueType STRING
        to initialize String value
      • NUMBER

        public static final BMValueType NUMBER
        It can be int, float, long, double or any 64 bit floating point number
      • UNDEFINED

        public static final BMValueType UNDEFINED
        to assign unidentified in JavaScript value, the value can be null for this data type.
      • NULL

        public static final BMValueType NULL
        to initialize null value
      • BOOLEAN

        public static final BMValueType BOOLEAN
        to initialize boolean value
      • BM_OBJECT

        public static final BMValueType BM_OBJECT
        to initialize another WffBMObject
      • BM_ARRAY

        public static final BMValueType BM_ARRAY
        to initialize another WffBMArray
      • REG_EXP

        public static final BMValueType REG_EXP
        to initialize reg expression
      • FUNCTION

        public static final BMValueType FUNCTION
        to initialize function, eg: function(arg) {alert(arg);}
         
         WffBMObject bmObject = new WffBMObject();
         bmObject.put("testMeFun", BMValueType.FUNCTION, "function(arg) {alert(arg);}");
         so the usage would be jsObject.testMeFun("Hello world");
         
         
      • BM_BYTE_ARRAY

        public static final BMValueType BM_BYTE_ARRAY
        to initialize binary data. In java it's byte data type and in JavaScript it's Int8Array.
      • INTERNAL_BYTE

        public static final BMValueType INTERNAL_BYTE
        Only for internal use not for development purpose. If value is a byte.
    • Method Detail

      • values

        public static BMValueType[] values​()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BMValueType c : BMValueType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BMValueType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getType

        public byte getType​()
      • getInstanceByType

        public static BMValueType getInstanceByType​(byte type)
        Parameters:
        type -
        Returns:
        the BMValueType instance by type
        Since:
        2.0.0