gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-19 12:50:40 24 4
gpt4 key购买 nike

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

XMLTransformationMapping.addFieldTransformer介绍

暂无

代码示例

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

public void addFieldTransformer(String fieldName, FieldTransformer transformer) {
  this.addFieldTransformer(new XMLField(fieldName), transformer);
}

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

public void addFieldTransformer(String fieldName, FieldTransformer transformer) {
  this.addFieldTransformer(new XMLField(fieldName), transformer);
}

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

public void addFieldTransformer(String fieldName, FieldTransformer transformer) {
  this.addFieldTransformer(new XMLField(fieldName), transformer);
}

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

private DatabaseMapping buildXMLTransformationMapping(String mappingUri) {
  XMLTransformationMapping mapping = new XMLTransformationMapping();
  mapping.setAttributeName(getName());
  String xpath = getQualifiedXPath(mappingUri, true);
  String xpathMinusText;
  int indexOfTextXPath = xpath.lastIndexOf("/text()");
  if (indexOfTextXPath < 0) {
    xpathMinusText = xpath;
  } else {
    xpathMinusText = xpath.substring(0, indexOfTextXPath);
  }
  QNameTransformer transformer = new QNameTransformer(xpath);
  mapping.setAttributeTransformer(transformer);
  mapping.addFieldTransformer(xpath, transformer);
  
  NamespaceResolver nsr = new NamespaceResolver();
  nsr.put(javax.xml.XMLConstants.XMLNS_ATTRIBUTE, javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
  XMLField field = new XMLField();
  field.setNamespaceResolver(nsr);
  field.setXPath(xpathMinusText + "/@" + javax.xml.XMLConstants.XMLNS_ATTRIBUTE + ":" + QNameTransformer.QNAME_NAMESPACE_PREFIX);
  
  mapping.addFieldTransformer(field, new NamespaceURITransformer());
  
  return mapping;
}

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

private DatabaseMapping buildXMLTransformationMapping(String mappingUri) {
  XMLTransformationMapping mapping = new XMLTransformationMapping();
  mapping.setAttributeName(getName());
  String xpath = getQualifiedXPath(mappingUri, true);
  String xpathMinusText;
  int indexOfTextXPath = xpath.lastIndexOf("/text()");
  if (indexOfTextXPath < 0) {
    xpathMinusText = xpath;
  } else {
    xpathMinusText = xpath.substring(0, indexOfTextXPath);
  }
  QNameTransformer transformer = new QNameTransformer(xpath);
  mapping.setAttributeTransformer(transformer);
  mapping.addFieldTransformer(xpath, transformer);
  NamespaceResolver nsr = new NamespaceResolver();
  nsr.put(javax.xml.XMLConstants.XMLNS_ATTRIBUTE, javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
  XMLField field = new XMLField();
  field.setNamespaceResolver(nsr);
  field.setXPath(xpathMinusText + "/@" + javax.xml.XMLConstants.XMLNS_ATTRIBUTE + ":" + QNameTransformer.QNAME_NAMESPACE_PREFIX);
  mapping.addFieldTransformer(field, new NamespaceURITransformer());
  return mapping;
}

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

protected XMLDescriptor buildProcedureOutputArgumentDescriptor() {
  XMLDescriptor descriptor = buildProcedureArgumentDescriptor();
  descriptor.setJavaClass(ProcedureOutputArgument.class);
  XMLTransformationMapping resultType = new XMLTransformationMapping();
  resultType.setAttributeName("resultType");
  QNameTransformer qNameTransformer = new QNameTransformer("type/text()");
  resultType.addFieldTransformer("type/text()", qNameTransformer);
  resultType.setAttributeTransformer(qNameTransformer);
  descriptor.addMapping(resultType);
  return descriptor;
}

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

protected XMLDescriptor buildProcedureOutputArgumentDescriptor() {
  XMLDescriptor descriptor = buildProcedureArgumentDescriptor();
  descriptor.setJavaClass(ProcedureOutputArgument.class);
  XMLTransformationMapping resultType = new XMLTransformationMapping();
  resultType.setAttributeName("resultType");
  QNameTransformer qNameTransformer = new QNameTransformer("type/text()");
  resultType.addFieldTransformer("type/text()", qNameTransformer);
  resultType.setAttributeTransformer(qNameTransformer);
  descriptor.addMapping(resultType);
  return descriptor;
}

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

private void initializeDescriptor(XMLDescriptor aDescriptor, QName aQName, Type aPropertyType, SDOProperty aValueProperty) {
  aDescriptor.setNamespaceResolver(null);
  SDOMethodAttributeAccessor accessor = null;
  accessor = new SDOMethodAttributeAccessor(aValueProperty);
  if (XMLConstants.QNAME_QNAME.equals(aQName)) {
    XMLTransformationMapping mapping = new XMLTransformationMapping();
    mapping.setAttributeName(ATTRIBUTE_NAME);
    QNameTransformer transformer = new QNameTransformer("text()");
    mapping.setAttributeTransformer(transformer);
    mapping.addFieldTransformer(XPATH, transformer);
    NamespaceResolver nsr = new NamespaceResolver();
    nsr.setDefaultNamespaceURI(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
    XMLField field = new XMLField();
    field.setNamespaceResolver(nsr);
    field.setXPath("@" + javax.xml.XMLConstants.XMLNS_ATTRIBUTE);
    mapping.addFieldTransformer(field, new NamespaceURITransformer());
    mapping.setAttributeAccessor(accessor);
    aDescriptor.addMapping(mapping);
  } else {
    XMLDirectMapping mapping = new XMLDirectMapping();
    mapping.setAttributeName(ATTRIBUTE_NAME);
    mapping.setXPath(XPATH);
    mapping.setAttributeClassification(aPropertyType.getInstanceClass());
    ((XMLField) mapping.getField()).setSchemaType(aQName);
    mapping.setAttributeAccessor(accessor);
    aDescriptor.addMapping(mapping);
  }
  aDescriptor.setIsWrapper(true);
}

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

private void initializeDescriptor(XMLDescriptor aDescriptor, QName aQName, Type aPropertyType, SDOProperty aValueProperty) {
  aDescriptor.setNamespaceResolver(null);
  SDOMethodAttributeAccessor accessor = null;
  accessor = new SDOMethodAttributeAccessor(aValueProperty);
  if (XMLConstants.QNAME_QNAME.equals(aQName)) {
    XMLTransformationMapping mapping = new XMLTransformationMapping();
    mapping.setAttributeName(ATTRIBUTE_NAME);
    QNameTransformer transformer = new QNameTransformer("text()");
    mapping.setAttributeTransformer(transformer);
    mapping.addFieldTransformer(XPATH, transformer);
    NamespaceResolver nsr = new NamespaceResolver();
    nsr.setDefaultNamespaceURI(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
    XMLField field = new XMLField();
    field.setNamespaceResolver(nsr);
    field.setXPath("@" + javax.xml.XMLConstants.XMLNS_ATTRIBUTE);
    mapping.addFieldTransformer(field, new NamespaceURITransformer());
    mapping.setAttributeAccessor(accessor);
    aDescriptor.addMapping(mapping);
  } else {
    XMLDirectMapping mapping = new XMLDirectMapping();
    mapping.setAttributeName(ATTRIBUTE_NAME);
    mapping.setXPath(XPATH);
    mapping.setAttributeClassification(aPropertyType.getInstanceClass());
    ((XMLField) mapping.getField()).setSchemaType(aQName);
    mapping.setAttributeAccessor(accessor);
    aDescriptor.addMapping(mapping);
  }
  aDescriptor.setIsWrapper(true);
}

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

protected XMLDescriptor buildParameterDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(Parameter.class);
  XMLDirectMapping name = new XMLDirectMapping();
  name.setAttributeName("name");
  name.setXPath("name/text()");
  descriptor.addMapping(name);
  XMLTransformationMapping type = new XMLTransformationMapping();
  type.setAttributeName("type");
  QNameTransformer qNameTransformer = new QNameTransformer("type/text()");
  type.addFieldTransformer("type/text()", qNameTransformer);
  type.setAttributeTransformer(qNameTransformer);
  descriptor.addMapping(type);
  XMLDirectMapping optional = new XMLDirectMapping();
  optional.setAttributeName("optional");
  optional.setXPath("@optional");
  optional.setNullValue(false);
  descriptor.addMapping(optional);
  return descriptor;
}

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

protected XMLDescriptor buildParameterDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(Parameter.class);
  XMLDirectMapping name = new XMLDirectMapping();
  name.setAttributeName("name");
  name.setXPath("name/text()");
  descriptor.addMapping(name);
  XMLTransformationMapping type = new XMLTransformationMapping();
  type.setAttributeName("type");
  QNameTransformer qNameTransformer = new QNameTransformer("type/text()");
  type.addFieldTransformer("type/text()", qNameTransformer);
  type.setAttributeTransformer(qNameTransformer);
  descriptor.addMapping(type);
  XMLDirectMapping optional = new XMLDirectMapping();
  optional.setAttributeName("optional");
  optional.setXPath("@optional");
  optional.setNullValue(false);
  descriptor.addMapping(optional);
  return descriptor;
}

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

versionMapping.addFieldTransformer("@version", getConstantTransformerForProjectVersionMapping());
descriptor.addMapping(versionMapping);

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

versionMapping.addFieldTransformer("@version", getConstantTransformerForProjectVersionMapping());
descriptor.addMapping(versionMapping);

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

versionMapping.addFieldTransformer("@version", getConstantTransformerForProjectVersionMapping());
descriptor.addMapping(versionMapping);

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

type.setAttributeName("type");
QNameTransformer qNameTransformer = new QNameTransformer("type/text()");
type.addFieldTransformer("type/text()", qNameTransformer);
type.setAttributeTransformer(qNameTransformer);
descriptor.addMapping(type);

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

type.setAttributeName("type");
QNameTransformer qNameTransformer = new QNameTransformer("type/text()");
type.addFieldTransformer("type/text()", qNameTransformer);
type.setAttributeTransformer(qNameTransformer);
descriptor.addMapping(type);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com