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

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

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

XMLCompositeDirectCollectionMapping.getValueConverter介绍

暂无

代码示例

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

public void writeSingleValue(Object value, Object parent, XMLRecord record, AbstractSession session) {
  Object element = value;
  if (hasValueConverter()) {
    if (getValueConverter() instanceof XMLConverter) {
      element = ((XMLConverter) getValueConverter()).convertObjectValueToDataValue(element, session, record.getMarshaller());
    } else {
      element = getValueConverter().convertObjectValueToDataValue(element, session);
    }
  }
  record.add(this.getField(), element);
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

Object element = cp.next(iter, session);
if (hasValueConverter()) {
  if (getValueConverter() instanceof XMLConverter) {
    element = ((XMLConverter) getValueConverter()).convertObjectValueToDataValue(element, session, ((XMLRecord) row).getMarshaller());
  } else {
    element = getValueConverter().convertObjectValueToDataValue(element, session);

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

private void addUnmarshalValue(UnmarshalRecord unmarshalRecord, Object value, Object collection) {
  if (null == value) {
    return;
  }
  if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(unmarshalRecord.getAttributes())) {
    return;
  }
  if ((!isWhitespaceAware() && XMLConstants.EMPTY_STRING.equals(value))) {
    return;
  }
  XMLField xmlField = (XMLField) xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager = (XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass = xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value = xmlConversionManager.convertObject(value, typeClass, unmarshalRecord.getTypeQName());
  } else {
    value = xmlField.convertValueBasedOnSchemaType(value, xmlConversionManager, unmarshalRecord);
  }
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller());
    } else {
      value = xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value, unmarshalRecord.getSession());
    }
  }
  
  unmarshalRecord.addAttributeValue(this, value, collection);
}

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

/**
 * INTERNAL:
 * Initialize the mapping.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.getField() instanceof XMLField && getValueConverter() instanceof TypeConversionConverter) {
    TypeConversionConverter converter = (TypeConversionConverter) getValueConverter();
    this.getField().setType(converter.getObjectClass());
  }
  ContainerPolicy cp = getContainerPolicy();
  if (cp != null) {
    if (cp.getContainerClass() == null) {
      Class cls = session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName());
      cp.setContainerClass(cls);
    }
  }
  ((XMLField) this.getField()).setIsCDATA(this.isCDATA());
}

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

Object element = stream.nextElement();
if (hasValueConverter()) {
  if (getValueConverter() instanceof XMLConverter) {
    element = ((XMLConverter) getValueConverter()).convertDataValueToObjectValue(element, executionSession, ((XMLRecord) row).getUnmarshaller());
  } else {
    element = getValueConverter().convertDataValueToObjectValue(element, executionSession);

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

public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertObjectValueToDataValue(value, session, marshalRecord.getMarshaller());
    } else {
      value = xmlCompositeDirectCollectionMapping.getValueConverter().convertObjectValueToDataValue(value, session);

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

objectValue = cp.next(iterator, session);
if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
  if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
    objectValue = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertObjectValueToDataValue(objectValue, session, marshalRecord.getMarshaller());
  } else {
    objectValue = xmlCompositeDirectCollectionMapping.getValueConverter().convertObjectValueToDataValue(objectValue, session);

相关文章