gpt4 book ai didi

org.eclipse.persistence.internal.oxm.XPathNode.marshal()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 03:05:40 39 4
gpt4 key购买 nike

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

XPathNode.marshal介绍

[英]Marshal any 'self' mapped attributes.
[中]封送任何“自”映射属性。

代码示例

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

public boolean marshalAttributes(MarshalRecord marshalRecord, Object object, AbstractSession session) {
  boolean hasValue = false;
  NamespaceResolver namespaceResolver = ((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
  List<XPathNode> attributeChildren = rootXPathNode.getAttributeChildren();
  if (null != attributeChildren) {
    for (int x = 0, attributeChildrenSize=attributeChildren.size(); x < attributeChildrenSize; x++) {
      hasValue = attributeChildren.get(x).marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (rootXPathNode.getAnyAttributeNode() != null) {
    hasValue = rootXPathNode.getAnyAttributeNode().marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance()) || hasValue;
  }
  List<XPathNode> selfChildren = rootXPathNode.getSelfChildren();
  if (null != selfChildren) {
    for (int x = 0, selfChildrenSize=selfChildren.size(); x < selfChildrenSize; x++) {
      selfChildren.get(x).marshalSelfAttributes(marshalRecord, object, session, namespaceResolver, marshalRecord.getMarshaller());
    }
  }
  return hasValue;
}

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

public boolean startElement(MarshalRecord marshalRecord, XPathFragment anXPathFragment, Object object, AbstractSession session, NamespaceResolver namespaceResolver, TreeObjectBuilder compositeObjectBuilder, Object compositeObject) {
  if (null == anXPathFragment) {
    return false;
  }
  marshalRecord.openStartElement(anXPathFragment, namespaceResolver);
  boolean hasValue = false;
  if (null != attributeChildren) {
    for (int x = 0, size = attributeChildren.size(); x < size; x++) {
      XPathNode attributeNode = (XPathNode)attributeChildren.get(x);
      hasValue = attributeNode.marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    //marshal the anyAttribute node here before closeStartElement()
    hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance()) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue = compositeObjectBuilder.marshalAttributes(marshalRecord, compositeObject, session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}

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

public boolean startElement(MarshalRecord marshalRecord, XPathFragment anXPathFragment, Object object, CoreAbstractSession session, NamespaceResolver namespaceResolver, ObjectBuilder compositeObjectBuilder, Object compositeObject) {
  if (null == anXPathFragment) {
    return false;
  }
  marshalRecord.openStartElement(anXPathFragment, namespaceResolver);
  boolean hasValue = false;
  marshalRecord.predicateAttribute(anXPathFragment, namespaceResolver);
  if (null != attributeChildren) {
    for (int x = 0, size = attributeChildren.size(); x < size; x++) {
      XPathNode attributeNode = attributeChildren.get(x);
      hasValue = attributeNode.marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance(), null) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    //marshal the anyAttribute node here before closeStartElement()
    hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance(), null) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue = compositeObjectBuilder.marshalAttributes(marshalRecord, compositeObject, session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}

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

ObjectMarshalContext objectMarshalContext = ObjectMarshalContext.getInstance();
for (XPathNode anAttributeChildren : attributeChildren) {
  hasValue = anAttributeChildren.marshal(marshalRecord, object, session, namespaceResolver, null, objectMarshalContext, null) || hasValue;
hasValue = rootXPathNode.getAnyAttributeNode().marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance(), null) || hasValue;

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

public boolean startElement(MarshalRecord marshalRecord, XPathFragment anXPathFragment, Object object, CoreAbstractSession session, NamespaceResolver namespaceResolver, ObjectBuilder compositeObjectBuilder, Object compositeObject) {
  if (null == anXPathFragment) {
    return false;
  }
  marshalRecord.openStartElement(anXPathFragment, namespaceResolver);
  boolean hasValue = false;
  marshalRecord.predicateAttribute(anXPathFragment, namespaceResolver);
  if (null != attributeChildren) {
    for (int x = 0, size = attributeChildren.size(); x < size; x++) {
      XPathNode attributeNode = attributeChildren.get(x);
      hasValue = attributeNode.marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance(), null) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    //marshal the anyAttribute node here before closeStartElement()
    hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance(), null) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue = compositeObjectBuilder.marshalAttributes(marshalRecord, compositeObject, session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}

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

ObjectMarshalContext objectMarshalContext = ObjectMarshalContext.getInstance();
for (XPathNode anAttributeChildren : attributeChildren) {
  hasValue = anAttributeChildren.marshal(marshalRecord, object, session, namespaceResolver, null, objectMarshalContext, null) || hasValue;
hasValue = rootXPathNode.getAnyAttributeNode().marshal(marshalRecord, object, session, namespaceResolver, null, ObjectMarshalContext.getInstance(), null) || hasValue;

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

public boolean marshal(MarshalRecord marshalRecord, Object object, AbstractSession session, NamespaceResolver namespaceResolver, XMLMarshaller marshaller, MarshalContext marshalContext) {
  if ((null == marshalNodeValue) || marshalNodeValue.isMarshalOnlyNodeValue()) {
    marshalRecord.addGroupingElement(this);
    boolean hasValue = false;
    if (null != attributeChildren) {
      for (int x = 0, size = attributeChildren.size(); x < size; x++) {
        XPathNode xPathNode = attributeChildren.get(x);
        hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance()) || hasValue;
      }
    }
    if (anyAttributeNode != null) {
      hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance()) || hasValue;
    }
    if (null != nonAttributeChildren) {
      for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(this); x < size; x++) {
        XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, this);
        MarshalContext childMarshalContext = marshalContext.getMarshalContext(x);
        hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, childMarshalContext) || hasValue;
      }
    }
    if (hasValue) {
      marshalRecord.endElement(xPathFragment, namespaceResolver);
    } else {
      marshalRecord.removeGroupingElement(this);
    }
    return hasValue;
  } else {
    return marshalContext.marshal(marshalNodeValue, xPathFragment, marshalRecord, object, session, namespaceResolver);
  }
}

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

wrapperXPathNode.setXPathFragment(this.getXPathFragment());
    wrapperXPathNode.setMarshalNodeValue(childXPathNode.getMarshalNodeValue());
    return wrapperXPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, marshalContext, rootFragment);
for (int x = 0, size = attributeChildren.size(); x < size; x++) {
  XPathNode xPathNode = attributeChildren.get(x);
  hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance(), this.xPathFragment) || hasValue;
hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance(), null) || hasValue;
  hasValue = textNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance(), null) || hasValue;
  XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, this);
  MarshalContext childMarshalContext = marshalContext.getMarshalContext(x);
  hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, childMarshalContext, this.xPathFragment) || hasValue;

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

wrapperXPathNode.setXPathFragment(this.getXPathFragment());
    wrapperXPathNode.setMarshalNodeValue(childXPathNode.getMarshalNodeValue());
    return wrapperXPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, marshalContext, rootFragment);
for (int x = 0, size = attributeChildren.size(); x < size; x++) {
  XPathNode xPathNode = attributeChildren.get(x);
  hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance(), this.xPathFragment) || hasValue;
hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance(), null) || hasValue;
  hasValue = textNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance(), null) || hasValue;
  XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, this);
  MarshalContext childMarshalContext = marshalContext.getMarshalContext(x);
  hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, childMarshalContext, this.xPathFragment) || hasValue;

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

@Override
public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, CoreAbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {
  if (xmlCollectionReferenceMapping.usesSingleNode()) {
    XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment, namespaceResolver, (String) value);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    } else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters((String) value);
    }
  } else {
    for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(branchNode); x < size; x++) {
      XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, branchNode);
      xPathNode.marshal(marshalRecord, value, session, namespaceResolver, marshalRecord.getMarshaller(), marshalContext.getMarshalContext(x), null);
    }
  }
  return true;
}

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

@Override
public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, CoreAbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {
  if (xmlCollectionReferenceMapping.usesSingleNode()) {
    XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment, namespaceResolver, (String) value);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    } else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters((String) value);
    }
  } else {
    for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(branchNode); x < size; x++) {
      XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, branchNode);
      xPathNode.marshal(marshalRecord, value, session, namespaceResolver, marshalRecord.getMarshaller(), marshalContext.getMarshalContext(x), null);
    }
    
  }
  return true;
}

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

@Override
public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {
  if (xmlCollectionReferenceMapping.usesSingleNode()) {
    XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment, namespaceResolver, (String) value);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    } else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters((String) value);
    }
  } else {
    for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(branchNode); x < size; x++) {
      XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, branchNode);
      xPathNode.marshal((MarshalRecord)marshalRecord, value, session, namespaceResolver, marshalRecord.getMarshaller(), marshalContext.getMarshalContext(x));
    }
    
  }
  return true;
}

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

textNode.marshal((MarshalRecord) record, object, session, namespaceResolver, marshaller, marshalContext, rootFragment);
} else {
  if (node == null) {
    for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(node); x < size; x++) {
      XPathNode xPathNode = (XPathNode) marshalContext.getNonAttributeChild(x, node);
      xPathNode.marshal((MarshalRecord) record, object, session, namespaceResolver, marshaller, marshalContext.getMarshalContext(x), rootFragment);

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

textNode.marshal((MarshalRecord) record, object, session, namespaceResolver, marshaller, marshalContext, rootFragment);
} else {
  if (node == null) {
    for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(node); x < size; x++) {
      XPathNode xPathNode = (XPathNode) marshalContext.getNonAttributeChild(x, node);
      xPathNode.marshal((MarshalRecord) record, object, session, namespaceResolver, marshaller, marshalContext.getMarshalContext(x), rootFragment);

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

public AbstractRecord buildRow(AbstractRecord record, Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, XMLMarshaller marshaller) {
  if (null == getRootXPathNode().getNonAttributeChildren()) {
    return record;
  }
  XMLDescriptor xmlDescriptor = (XMLDescriptor) this.descriptor;
  NamespaceResolver namespaceResolver = xmlDescriptor.getNamespaceResolver();
  MarshalContext marshalContext = null;
  if(xmlDescriptor.isSequencedObject()) {
    SequencedObject sequencedObject = (SequencedObject) object;
    marshalContext = new SequencedMarshalContext(sequencedObject.getSettings());
  } else {
    marshalContext = ObjectMarshalContext.getInstance();
  }
  for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(getRootXPathNode()); x < size; x++) {
    XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, getRootXPathNode());
    xPathNode.marshal((MarshalRecord)record, object, session, namespaceResolver, marshaller, marshalContext.getMarshalContext(x));
  }
  return record;
}

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