gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-26 04:09:05 28 4
gpt4 key购买 nike

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

XPathFragment.isSelfFragment介绍

[英]INTERNAL: Indicates if the xpath is "."
[中]内部:指示xpath是否为“”

代码示例

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

/**
 * INTERNAL:
 * Indicates if the xpath for this field is "."
 *
 * @return true if the xpath is ".", false otherwise
 */
public boolean isSelfField() {
  if (null == xPathFragment) {
    return false;
  }
  return xPathFragment.isSelfFragment();
}

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

/**
 * INTERNAL:
 * Indicates if the xpath for this field is "."
 *
 * @return true if the xpath is ".", false otherwise
 */
public boolean isSelfField() {
  if (null == xPathFragment) {
    return false;
  }
  return xPathFragment.isSelfFragment();
}

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

/**
 * INTERNAL:
 * Indicates if the xpath for this field is "."
 *
 * @return true if the xpath is ".", false otherwise
 */
public boolean isSelfField() {
  if (null == xPathFragment) {
    return false;
  }
  return xPathFragment.isSelfFragment();
}

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

@Override
public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, WriteType writeType) {
  Object attributeValue = getAttributeValueFromObject(object);
  if (attributeValue == null) {
    XMLField field = (XMLField) getField();
    if(getNullPolicy() != null && !field.getXPathFragment().isSelfFragment()) {
      getNullPolicy().directMarshal((Field) this.getField(), (XMLRecord) row, object);
    }
    return;            
  }
  writeSingleValue(attributeValue, object, (XMLRecord) row, session);
}

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

@Override
public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, WriteType writeType) {
  Object attributeValue = getAttributeValueFromObject(object);
  if (attributeValue == null) {
    XMLField field = (XMLField) getField();
    if(getNullPolicy() != null && !field.getXPathFragment().isSelfFragment()) {
      getNullPolicy().directMarshal((Field) this.getField(), (XMLRecord) row, object);
    }
    return;
  }
  writeSingleValue(attributeValue, object, (XMLRecord) row, session);
}

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

private Node getSingleNode(Node contextNode, XPathFragment xPathFragment, XMLNamespaceResolver xmlNamespaceResolver) {
  if (xPathFragment.isAttribute()) {
    return selectSingleAttribute(contextNode, xPathFragment, xmlNamespaceResolver);
  } else if (xPathFragment.nameIsText()) {
    return selectSingleText(contextNode);
  } else if (xPathFragment.isSelfFragment()) {
    return contextNode;
  }
  if (xPathFragment.containsIndex()) {
    return selectSingleElement(contextNode, xPathFragment, xmlNamespaceResolver, xPathFragment.getIndexValue());
  }
  return selectSingleElement(contextNode, xPathFragment, xmlNamespaceResolver);
}

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

private Node getSingleNode(Node contextNode, XPathFragment xPathFragment, XMLNamespaceResolver xmlNamespaceResolver) {
  if (xPathFragment.isAttribute()) {
    return selectSingleAttribute(contextNode, xPathFragment, xmlNamespaceResolver);
  } else if (xPathFragment.nameIsText()) {
    return selectSingleText(contextNode);
  } else if (xPathFragment.isSelfFragment()) {
    return contextNode;
  }
  if (xPathFragment.containsIndex()) {
    return selectSingleElement(contextNode, xPathFragment, xmlNamespaceResolver, xPathFragment.getIndexValue());
  }
  return selectSingleElement(contextNode, xPathFragment, xmlNamespaceResolver);
}

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

private Node getSingleNode(Node contextNode, XPathFragment xPathFragment, XMLNamespaceResolver xmlNamespaceResolver) {
  if (xPathFragment.isAttribute()) {
    return selectSingleAttribute(contextNode, xPathFragment, xmlNamespaceResolver);
  } else if (xPathFragment.nameIsText()) {
    return selectSingleText(contextNode);
  } else if (xPathFragment.isSelfFragment()) {
    return contextNode;
  }
  if (xPathFragment.containsIndex()) {
    return selectSingleElement(contextNode, xPathFragment, xmlNamespaceResolver, xPathFragment.getIndexValue());
  }
  return selectSingleElement(contextNode, xPathFragment, xmlNamespaceResolver);
}

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

private NodeList getNodes(Node contextNode, XPathFragment xPathFragment, XMLNamespaceResolver xmlNamespaceResolver, AbstractNullPolicy nullPolicy) {
  if (xPathFragment.isAttribute()) {
    return selectAttributeNodes(contextNode, xPathFragment, xmlNamespaceResolver);
  } else if (xPathFragment.nameIsText()) {
    return selectTextNodes(contextNode, nullPolicy);
  } else if (xPathFragment.isSelfFragment()) {
    XMLNodeList xmlNodeList = new XMLNodeList(1);
    xmlNodeList.add(contextNode);
    return xmlNodeList;
  }
  if (xPathFragment.containsIndex()) {
    return selectElementNodes(contextNode, xPathFragment, xmlNamespaceResolver, xPathFragment.getIndexValue());
  }
  return selectElementNodes(contextNode, xPathFragment, xmlNamespaceResolver);
}

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

/**
 * Return the last fragment before text() in the XPath that a given XPathFragment
 * is part of.
 *
 * @param frag
 * @return
 */
protected XPathFragment getTargetXPathFragment(XPathFragment frag) {
  if (frag.isAttribute() || frag.isSelfFragment()) {
    return frag;
  }
  while (frag.getNextFragment() != null && !frag.getNextFragment().nameIsText()) {
    frag = frag.getNextFragment();
    if (frag.getNextFragment() == null || frag.getNextFragment().nameIsText()) {
      break;
    }
  }
  return frag;
}

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

/**
 * Return the last fragment before text() in the XPath that a given XPathFragment 
 * is part of.
 * 
 * @param frag
 * @return
 */
protected XPathFragment getTargetXPathFragment(XPathFragment frag) {
  if (frag.isAttribute() || frag.isSelfFragment()) {
    return frag;
  }
  while (frag.getNextFragment() != null && !frag.getNextFragment().nameIsText()) {
    frag = frag.getNextFragment();
    if (frag.getNextFragment() == null || frag.getNextFragment().nameIsText()) {
      break;
    }
  }
  return frag;
}

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

/**
 * Return the last fragment before text() in the XPath that a given XPathFragment 
 * is part of.
 * 
 * @param frag
 * @return
 */
protected XPathFragment getTargetXPathFragment(XPathFragment frag) {
  if (frag.isAttribute() || frag.isSelfFragment()) {
    return frag;
  }
  while (frag.getNextFragment() != null && !frag.getNextFragment().nameIsText()) {
    frag = frag.getNextFragment();
    if (frag.getNextFragment() == null || frag.getNextFragment().nameIsText()) {
      break;
    }
  }
  return frag;
}

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

private NodeList getNodes(Node contextNode, XPathFragment xPathFragment, XMLNamespaceResolver xmlNamespaceResolver, AbstractNullPolicy nullPolicy, boolean concatText) {
  if (xPathFragment.isAttribute()) {
    return selectAttributeNodes(contextNode, xPathFragment, xmlNamespaceResolver);
  } else if (xPathFragment.nameIsText()) {
    return selectTextNodes(contextNode, nullPolicy, concatText);
  } else if (xPathFragment.isSelfFragment()) {
    XMLNodeList xmlNodeList = new XMLNodeList(1);
    xmlNodeList.add(contextNode);
    return xmlNodeList;
  }
  if (xPathFragment.containsIndex()) {
    return selectElementNodes(contextNode, xPathFragment, xmlNamespaceResolver, xPathFragment.getIndexValue());
  }
  return selectElementNodes(contextNode, xPathFragment, xmlNamespaceResolver);
}

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

private NodeList getNodes(Node contextNode, XPathFragment xPathFragment, XMLNamespaceResolver xmlNamespaceResolver, AbstractNullPolicy nullPolicy, boolean concatText) {
  if (xPathFragment.isAttribute()) {
    return selectAttributeNodes(contextNode, xPathFragment, xmlNamespaceResolver);
  } else if (xPathFragment.nameIsText()) {
    return selectTextNodes(contextNode, nullPolicy, concatText);
  } else if (xPathFragment.isSelfFragment()) {
    XMLNodeList xmlNodeList = new XMLNodeList(1);
    xmlNodeList.add(contextNode);
    return xmlNodeList;
  }
  if (xPathFragment.containsIndex()) {
    return selectElementNodes(contextNode, xPathFragment, xmlNamespaceResolver, xPathFragment.getIndexValue());
  }
  return selectElementNodes(contextNode, xPathFragment, xmlNamespaceResolver);
}

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

/**
 * Handle marshal of an empty collection.  
 * @param xPathFragment
 * @param namespaceResolver
 * @param openGrouping if grouping elements should be marshalled for empty collections
 * @return
 */    
public boolean emptyCollection(XPathFragment xPathFragment, NamespaceResolver namespaceResolver, boolean openGrouping) {    	
   if(marshaller.isMarshalEmptyCollections()){  
     super.emptyCollection(xPathFragment, namespaceResolver, true);
    if (null != xPathFragment) {
      startCollection();
      if (!xPathFragment.isSelfFragment()) {
        openStartElement(xPathFragment, namespaceResolver);
        if (null != level) {
          level.setNeedToCloseComplex(false);
          level.setNeedToOpenComplex(false);
        }
        endElement(xPathFragment, namespaceResolver);
      }
      endEmptyCollection();
    }
     return true;
   }else{
     return super.emptyCollection(xPathFragment, namespaceResolver, openGrouping);
   }
}

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

/**
 * Handle marshal of an empty collection.
 * @param xPathFragment
 * @param namespaceResolver
 * @param openGrouping if grouping elements should be marshalled for empty collections
 * @return
 */
public boolean emptyCollection(XPathFragment xPathFragment, NamespaceResolver namespaceResolver, boolean openGrouping) {
   if(marshaller.isMarshalEmptyCollections()){
     super.emptyCollection(xPathFragment, namespaceResolver, true);
    if (null != xPathFragment) {
      startCollection();
      if (!xPathFragment.isSelfFragment()) {
        openStartElement(xPathFragment, namespaceResolver);
        if (null != level) {
          level.setNeedToCloseComplex(false);
          level.setNeedToOpenComplex(false);
        }
        endElement(xPathFragment, namespaceResolver);
      }
      endEmptyCollection();
    }
     return true;
   }else{
     return super.emptyCollection(xPathFragment, namespaceResolver, openGrouping);
   }
}

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

if(xPathFragment.isSelfFragment() || xPathFragment.nameIsText()){
  String keyName = position.getKeyName();
  setComplex(position, false);

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

if(xPathFragment.isSelfFragment() || xPathFragment.nameIsText()){
  String keyName = position.getKeyName();
  setComplex(position, false);

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

if (frag.isSelfFragment()) {

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

if (frag.isSelfFragment()) {

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