org.apache.openjpa.lib.conf.Value.setInternalObject()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(71)

本文整理了Java中org.apache.openjpa.lib.conf.Value.setInternalObject()方法的一些代码示例,展示了Value.setInternalObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.setInternalObject()方法的具体详情如下:
包路径:org.apache.openjpa.lib.conf.Value
类名称:Value
方法名:setInternalObject

Value.setInternalObject介绍

[英]Set this value from an object.
[中]从对象设置此值。

代码示例

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Set this value as an object.
 * <br>
 * If this Value is being set to a non-default value for the first time
 * (as designated by <code>originalString</code> being null), then the
 * value is remembered as <em>original</em>. This original value is used
 * for equality and hashCode computation if this Value is
 * {@link #isDynamic() dynamic}. 
 * 
 */
public void setObject(Object obj) {
  // if setting to null set as string to get defaults into play
  if (obj == null && def != null)
    setString(null);
  else {
    try {
      setInternalObject(obj);
      if (originalValue == null && obj != null && !isDefault(obj)) {
        originalValue = getString();
      }
    } catch (ParseException pe) {
      throw pe;
    } catch (RuntimeException re) {
      throw new ParseException(prop + ": " + obj, re);
    }
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Set this value as an object.
 * <br>
 * If this Value is being set to a non-default value for the first time
 * (as designated by <code>originalString</code> being null), then the
 * value is remembered as <em>original</em>. This original value is used
 * for equality and hashCode computation if this Value is
 * {@link #isDynamic() dynamic}. 
 * 
 */
public void setObject(Object obj) {
  // if setting to null set as string to get defaults into play
  if (obj == null && def != null)
    setString(null);
  else {
    try {
      setInternalObject(obj);
      if (originalValue == null && obj != null && !isDefault(obj)) {
        originalValue = getString();
      }
    } catch (ParseException pe) {
      throw pe;
    } catch (RuntimeException re) {
      throw new ParseException(prop + ": " + obj, re);
    }
  }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Set this value as an object.
 * <br>
 * If this Value is being set to a non-default value for the first time
 * (as designated by <code>originalString</code> being null), then the
 * value is remembered as <em>original</em>. This original value is used
 * for equality and hashCode computation if this Value is
 * {@link #isDynamic() dynamic}. 
 * 
 */
public void setObject(Object obj) {
  // if setting to null set as string to get defaults into play
  if (obj == null && def != null)
    setString(null);
  else {
    try {
      setInternalObject(obj);
      if (originalValue == null && obj != null && !isDefault(obj)) {
        originalValue = getString();
      }
    } catch (ParseException pe) {
      throw pe;
    } catch (RuntimeException re) {
      throw new ParseException(prop + ": " + obj, re);
    }
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Set this value as an object.
 * <br>
 * If this Value is being set to a non-default value for the first time
 * (as designated by <code>originalString</code> being null), then the
 * value is remembered as <em>original</em>. This original value is used
 * for equality and hashCode computation if this Value is
 * {@link #isDynamic() dynamic}. 
 * 
 */
public void setObject(Object obj) {
  // if setting to null set as string to get defaults into play
  if (obj == null && def != null)
    setString(null);
  else {
    try {
      setInternalObject(obj);
      if (originalValue == null && obj != null && !isDefault(obj)) {
        originalValue = getString();
      }
    } catch (ParseException pe) {
      throw pe;
    } catch (RuntimeException re) {
      throw new ParseException(prop + ": " + obj, re);
    }
  }
}

相关文章