读取指定的数据类型

@param {string} type 数据类型
@param {number} value value值
@param {number=} offset 位移
@param {boolean=} littleEndian 是否小尾

@return {this}
553791
function write(type, value, offset, littleEndian) {

            // 使用当前位移
            if (undefined === offset) {
                offset = this.offset;
            }

            // 使用小尾
            if (undefined === littleEndian) {
                littleEndian = this.littleEndian;
            }

            // 扩展方法
            if (undefined === dataType[type]) {
                return this['write' + type](value, offset, littleEndian);
            }

            var size = dataType[type];
            this.offset = offset + size;
            this.view['set' + type](offset, value, littleEndian);
            return this;
        }
932581
public static InParameter in(final int type, final Object value) {
        return new InParameter() {
            public int getType() {
                return type;
            }

            public Object getValue() {
                return value;
            }
        };
    }
918612
public static void writeIntegerLittleEndian(ByteBuffer io, int value) {
		io.put((byte)(value & 0xFF));
		io.put((byte)((value >> 8) & 0xFF));
		io.put((byte)((value >> 16) & 0xFF));
		io.put((byte)((value >> 24) & 0xFF));
	}
8704
function(value){
    if(_.isUndefined(value) || !_.isObject(value))
        return false;

    return (value instanceof BigNumber) ? true : false;
}
661609
int addType(final String value) {
    int hashCode = hash(Symbol.TYPE_TAG, value);
    Entry entry = get(hashCode);
    while (entry != null) {
      if (entry.tag == Symbol.TYPE_TAG && entry.hashCode == hashCode && entry.value.equals(value)) {
        return entry.index;
      }
      entry = entry.next;
    }
    return addType(new Entry(typeCount, Symbol.TYPE_TAG, value, hashCode));
  }
488889
function( buffer, offset ) {

    if( !Buffer.isBuffer( buffer ) )
      throw new TypeError( 'Value must be a buffer' )

    offset = offset || 0

    return this.fromNumber( buffer.readUIntLE( offset, 3 ) )

  }
662466
protected static Object convertBasicValue(String value, Class<?> type) {
        if (type == null) {
            throw new IllegalArgumentException("Type cannot be null");
        }

        if (String.class.equals(type)) {
            return value;
        }

        if (value == null || value.trim().isEmpty()) {
            return null;
        }

        try {
            value = value.trim();
            if (Byte.class.equals(type)) {
                return Byte.parseByte(value);
            } else if (Short.class.equals(type)) {
                return Short.parseShort(value);
            } else if (Integer.class.equals(type)) {
                return Integer.parseInt(value);
            } else if (Long.class.equals(type)) {
                return Long.parseLong(value);
            } else if (BigInteger.class.equals(type)) {
                return new BigInteger(value);
            } else if (Float.class.equals(type)) {
                return Float.parseFloat(value);
            } else if (Double.class.equals(type)) {
                return Double.parseDouble(value);
            } else if (BigDecimal.class.equals(type)) {
                return new BigDecimal(value);
            } else if (Boolean.class.equals(type)) {
                return Boolean.parseBoolean(value);
            }
        } catch (Exception e) {
            throw new UniformException(String.format("Error while converting value %s to data type %s. Make sure the element has correct values and/or validators", value, type.getName()), e);
        }

        throw new UnsupportedOperationException("Could not convert value to unknown type: " + type.getName());
    }
543114
function(type, value) {
    if (type.name === 'String') {
      // crop strings at 10k characters
      if (value.length > 10000) {
        value = value.slice(0, 10000);
      }
    }
    type.values.pushSome(value);
  }
995689
function typeOf(value, options) {
            if (value === undefined) return '#Undefined';
            if (value === null) return '#Null';
            if (options !== 'forceObjectToString') {
                var constructor = getConstructor(value);
                if (constructor !== null) {
                    var type = getFunctionName(constructor);
                    if (type === 'Object') {
                        return getObjectToStringValue(value);
                    }
                    return (type === 'Number' && value != +value) ? '#NaN' : type;
                }
            }
            return getObjectToStringValue(value);
        }
1167977
function num(type, value) {
  var val;
  if(type === NUMERIC.INTEGER) {
    val = utils.strtoint(value);
    if(isNaN(val)) throw IntegerRange;
  }else{
    val = utils.strtofloat(value);
    if(isNaN(val)) throw InvalidFloat;
  }
  return val;
}
1295643
function(type){
    var i = 1
      , la;

    while (la = this.lookahead(i++)) {
      if (~['indent', 'outdent', 'newline', 'eos'].indexOf(la.type)) return;
      if (type == la.type) return true;
    }
  }
33034
public void specify(Type value) {
        if (value instanceof GenericArrayType) {
            this.specify = ((GenericArrayType) value).getGenericComponentType();
        } else if (value instanceof Class && ((Class) value).isArray()) {
            this.specify = ((Class) value).getComponentType();
        } else {
            this.specify = value;
        }
    }
168117
private Object convert(Object value, String type) {
        if (EnumRuleType.STRING.equals(type)) {
            if (!(value instanceof String)) {
                return String.valueOf(value);
            }
        } else if (EnumRuleType.DOUBLE.equals(type)) {
            if (!(value instanceof Double)) {
                if (value instanceof Number) {
                    return NumberUtils.convertNumberToTargetClass((Number) value, Double.class);
                } else {
                    return NumberUtils.parseNumber(value.toString(), Double.class);
                }
            }
        } else if (EnumRuleType.INTEGER.equals(type)) {
            if (!(value instanceof Integer)) {
                if (value instanceof Number) {
                    return NumberUtils.convertNumberToTargetClass((Number) value, Integer.class);
                } else {
                    return NumberUtils.parseNumber(value.toString(), Integer.class);
                }
            }
        }
        return value;
    }
575645
public TypeValuePairType getTypeValuePair(String type, String value) {
        return getTypeValuePair(type, value.getBytes(StandardCharsets.UTF_8));
    }
1065006
public static Object toObject(String type, String value){
        if(StringHelper.isEmpty(value) || EMPTY_STRING.equals(value)){
            return null;
        }
        com.centurylink.mdw.variable.VariableTranslator trans = getTranslator(type);
        return trans.toObject(value);
    }
1204486
public SmartHandle returnValue(Class<?> type, Object value) {
        return new SmartHandle(signature.changeReturn(type), MethodHandles.filterReturnValue(handle, MethodHandles.constant(type, value)));
    }
132977
@Deprecated
    public static Object coerceType(Class<?> type, Object value)
    {
        return coerceTypeImpl(type, value);
    }