org.eclipse.persistence.oxm.mappings.XMLDirectMapping.setNullValue()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(13.2k)|赞(0)|评价(0)|浏览(107)

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

XMLDirectMapping.setNullValue介绍

[英]PUBLIC: Set whether this mapping's value should be marshalled, in the case that it is equal to the default null value.
[中]PUBLIC:设置是否应该封送此映射的值,如果它等于默认的null值。

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
public ClassDescriptor buildDatabaseLoginDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseLoginDescriptor();
  XMLDirectMapping shouldBindAllParametersMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("shouldBindAllParameters");
  shouldBindAllParametersMapping.setNullValue(Boolean.TRUE);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
public ClassDescriptor buildDatabaseLoginDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseLoginDescriptor();
  XMLDirectMapping shouldBindAllParametersMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("shouldBindAllParameters");
  shouldBindAllParametersMapping.setNullValue(Boolean.TRUE);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

public ClassDescriptor buildCommandsConfigDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(CommandsConfig.class);
  XMLDirectMapping cacheSyncMapping = new XMLDirectMapping();
  cacheSyncMapping.setAttributeName("m_cacheSync");
  cacheSyncMapping.setGetMethodName("getCacheSync");
  cacheSyncMapping.setSetMethodName("setCacheSync");
  cacheSyncMapping.setXPath("cache-sync/text()");
  cacheSyncMapping.setNullValue(Boolean.valueOf(CACHE_SYNC_DEFAULT));
  descriptor.addMapping(cacheSyncMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public ClassDescriptor buildCommandsConfigDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(CommandsConfig.class);
  XMLDirectMapping cacheSyncMapping = new XMLDirectMapping();
  cacheSyncMapping.setAttributeName("m_cacheSync");
  cacheSyncMapping.setGetMethodName("getCacheSync");
  cacheSyncMapping.setSetMethodName("setCacheSync");
  cacheSyncMapping.setXPath("cache-sync/text()");
  cacheSyncMapping.setNullValue(new Boolean(CACHE_SYNC_DEFAULT));
  descriptor.addMapping(cacheSyncMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

public ClassDescriptor buildCommandsConfigDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(CommandsConfig.class);
  XMLDirectMapping cacheSyncMapping = new XMLDirectMapping();
  cacheSyncMapping.setAttributeName("m_cacheSync");
  cacheSyncMapping.setGetMethodName("getCacheSync");
  cacheSyncMapping.setSetMethodName("setCacheSync");
  cacheSyncMapping.setXPath("cache-sync/text()");
  cacheSyncMapping.setNullValue(Boolean.valueOf(CACHE_SYNC_DEFAULT));
  descriptor.addMapping(cacheSyncMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

protected ClassDescriptor buildOXXMLDescriptorDescriptor() {
  ClassDescriptor descriptor = super.buildOXXMLDescriptorDescriptor();
  XMLDirectMapping alwaysXMLRootMapping = new XMLDirectMapping();
  alwaysXMLRootMapping.setAttributeName("resultAlwaysXMLRoot");
  alwaysXMLRootMapping.setGetMethodName("isResultAlwaysXMLRoot");
  alwaysXMLRootMapping.setSetMethodName("setResultAlwaysXMLRoot");
  alwaysXMLRootMapping.setNullValue(Boolean.FALSE);
  alwaysXMLRootMapping.setXPath(getPrimaryNamespaceXPath() + "result-always-xml-root/text()");
  descriptor.addMapping(alwaysXMLRootMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
protected ClassDescriptor buildXMLAnyCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLAnyCollectionMappingDescriptor();
  XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
  reuseContainerMapping.setAttributeName("reuseContainer");
  reuseContainerMapping.setGetMethodName("getReuseContainer");
  reuseContainerMapping.setSetMethodName("setReuseContainer");
  reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
  reuseContainerMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(reuseContainerMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
protected ClassDescriptor buildXMLChoiceCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLChoiceCollectionMappingDescriptor();
  XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
  reuseContainerMapping.setAttributeName("reuseContainer");
  reuseContainerMapping.setGetMethodName("getReuseContainer");
  reuseContainerMapping.setSetMethodName("setReuseContainer");
  reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
  reuseContainerMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(reuseContainerMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildXMLAnyObjectMappingDescriptor();
  XMLDirectMapping xmlRootMapping = new XMLDirectMapping();
  xmlRootMapping.setAttributeName("useXMLRoot");
  xmlRootMapping.setGetMethodName("usesXMLRoot");
  xmlRootMapping.setSetMethodName("setUseXMLRoot");
  xmlRootMapping.setXPath(getPrimaryNamespaceXPath() + "use-xml-root/text()");
  xmlRootMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(xmlRootMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
protected ClassDescriptor buildXMLFragmentCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLFragmentCollectionMappingDescriptor();
  XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
  reuseContainerMapping.setAttributeName("reuseContainer");
  reuseContainerMapping.setGetMethodName("getReuseContainer");
  reuseContainerMapping.setSetMethodName("setReuseContainer");
  reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
  reuseContainerMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(reuseContainerMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected ClassDescriptor buildXMLFieldDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLFieldDescriptor();
  XMLDirectMapping isRequiredMapping = new XMLDirectMapping();
  isRequiredMapping.setAttributeName("isRequired");
  isRequiredMapping.setGetMethodName("isRequired");
  isRequiredMapping.setSetMethodName("setRequired");
  isRequiredMapping.setXPath(getPrimaryNamespaceXPath() + "@is-required");
  isRequiredMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(isRequiredMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected ClassDescriptor buildXMLAnyCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLAnyCollectionMappingDescriptor();
  XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
  reuseContainerMapping.setAttributeName("reuseContainer");
  reuseContainerMapping.setGetMethodName("getReuseContainer");
  reuseContainerMapping.setSetMethodName("setReuseContainer");
  reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
  reuseContainerMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(reuseContainerMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildXMLAnyObjectMappingDescriptor();
  XMLDirectMapping xmlRootMapping = new XMLDirectMapping();
  xmlRootMapping.setAttributeName("useXMLRoot");
  xmlRootMapping.setGetMethodName("usesXMLRoot");
  xmlRootMapping.setSetMethodName("setUseXMLRoot");
  xmlRootMapping.setXPath(getPrimaryNamespaceXPath() + "use-xml-root/text()");
  xmlRootMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(xmlRootMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected ClassDescriptor buildXMLChoiceCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLChoiceCollectionMappingDescriptor();
  XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
  reuseContainerMapping.setAttributeName("reuseContainer");
  reuseContainerMapping.setGetMethodName("getReuseContainer");
  reuseContainerMapping.setSetMethodName("setReuseContainer");
  reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
  reuseContainerMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(reuseContainerMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected ClassDescriptor buildXMLFragmentCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLFragmentCollectionMappingDescriptor();
  XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
  reuseContainerMapping.setAttributeName("reuseContainer");
  reuseContainerMapping.setGetMethodName("getReuseContainer");
  reuseContainerMapping.setSetMethodName("setReuseContainer");
  reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
  reuseContainerMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(reuseContainerMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected ClassDescriptor buildOXXMLDescriptorDescriptor() {
  ClassDescriptor descriptor = super.buildOXXMLDescriptorDescriptor();
  XMLDirectMapping alwaysXMLRootMapping = new XMLDirectMapping();
  alwaysXMLRootMapping.setAttributeName("resultAlwaysXMLRoot");
  alwaysXMLRootMapping.setGetMethodName("isResultAlwaysXMLRoot");
  alwaysXMLRootMapping.setSetMethodName("setResultAlwaysXMLRoot");
  alwaysXMLRootMapping.setNullValue(Boolean.FALSE);
  alwaysXMLRootMapping.setXPath(getPrimaryNamespaceXPath() + "result-always-xml-root/text()");
  descriptor.addMapping(alwaysXMLRootMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

@Override
protected ClassDescriptor buildXMLCompositeDirectCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildXMLCompositeDirectCollectionMappingDescriptor();
  XMLDirectMapping isCDATAMapping = new XMLDirectMapping();
  isCDATAMapping.setAttributeName("isCDATA");
  isCDATAMapping.setGetMethodName("isCDATA");
  isCDATAMapping.setSetMethodName("setIsCDATA");
  isCDATAMapping.setXPath(getPrimaryNamespaceXPath() + "is-cdata/text()");
  isCDATAMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(isCDATAMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected ClassDescriptor buildXMLCompositeDirectCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildXMLCompositeDirectCollectionMappingDescriptor();
  XMLDirectMapping isCDATAMapping = new XMLDirectMapping();
  isCDATAMapping.setAttributeName("isCDATA");
  isCDATAMapping.setGetMethodName("isCDATA");
  isCDATAMapping.setSetMethodName("setIsCDATA");
  isCDATAMapping.setXPath(getPrimaryNamespaceXPath() + "is-cdata/text()");
  isCDATAMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(isCDATAMapping);
  return descriptor;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

protected ClassDescriptor buildOXXMLDescriptorDescriptor() {
  ClassDescriptor descriptor = super.buildOXXMLDescriptorDescriptor();
  XMLDirectMapping alwaysXMLRootMapping = new XMLDirectMapping();
  alwaysXMLRootMapping.setAttributeName("resultAlwaysXMLRoot");
  alwaysXMLRootMapping.setGetMethodName("isResultAlwaysXMLRoot");
  alwaysXMLRootMapping.setSetMethodName("setResultAlwaysXMLRoot");
  alwaysXMLRootMapping.setNullValue(Boolean.FALSE);
  alwaysXMLRootMapping.setXPath(getPrimaryNamespaceXPath() + "result-always-xml-root/text()");
  descriptor.addMapping(alwaysXMLRootMapping);
  return descriptor;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

protected ClassDescriptor buildNullPolicyDescriptor() {
  XMLDescriptor aDescriptor = new XMLDescriptor();
  aDescriptor.setJavaClass(NullPolicy.class);
  aDescriptor.getInheritancePolicy().setParentClass(AbstractNullPolicy.class);
  // This boolean can only be set on the NullPolicy implementation even though the field is on the abstract class
  XMLDirectMapping xnranMapping = new XMLDirectMapping();
  xnranMapping.setAttributeName("isSetPerformedForAbsentNode");
  xnranMapping.setXPath(getPrimaryNamespaceXPath() + "is-set-performed-for-absent-node/text()");
  xnranMapping.setNullValue(Boolean.TRUE);
  aDescriptor.addMapping(xnranMapping);
  return aDescriptor;
}

相关文章

微信公众号

最新文章

更多