gpt4 book ai didi

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

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

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

XPathFragment.isAttribute介绍

暂无

代码示例

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

public boolean isOwningNode(XPathFragment xPathFragment) {
  if(null == xPathFragment) {
    return false;
  }
  return xPathFragment.isAttribute();
}

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

/**
 * Indicate if the XPathFragment is an attribute or text() node.
 */
public boolean isOwningNode(XPathFragment xPathFragment) {
  return xPathFragment.isAttribute() || xPathFragment.nameIsText();
}

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

/**
 * Indicate if the XPathFragment is an attribute or text() node.
 */
public boolean isOwningNode(XPathFragment xPathFragment) {
  return xPathFragment.isAttribute() || xPathFragment.nameIsText();
}

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

/**
 * Indicate if the XPathFragment is an attribute or text() node.
 */
public boolean isOwningNode(XPathFragment xPathFragment) {
  return xPathFragment.isAttribute() || xPathFragment.nameIsText();
}

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

@Override
public boolean isOwningNode(XPathFragment xPathFragment) {
  return (xPathFragment.getNextFragment() == null) || xPathFragment.isAttribute();
}

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

public boolean isOwningNode(XPathFragment xPathFragment) {
   XPathFragment nextFragment = xPathFragment.getNextFragment();
   if (nextFragment == null || xmlCompositeDirectCollectionMapping.usesSingleNode()) {
     return xPathFragment.isAttribute() || xPathFragment.nameIsText();
   } else {
     return  (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
   }
}

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

public boolean isOwningNode(XPathFragment xPathFragment) {
   XPathFragment nextFragment = xPathFragment.getNextFragment();
   if (nextFragment == null || xmlCompositeDirectCollectionMapping.usesSingleNode()) {
     return xPathFragment.isAttribute() || xPathFragment.nameIsText();
   } else {
     return  (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
   }
}

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

public boolean isOwningNode(XPathFragment xPathFragment) {
  if (xmlCompositeDirectCollectionMapping.usesSingleNode()) {
    return xPathFragment.nameIsText() || xPathFragment.isAttribute();
  } else {
    XPathFragment nextFragment = xPathFragment.getNextFragment();
    return (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
  }
}

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

/**
 * Indicate if the next XPathFragment is an attribute or text() node.
 */
public boolean isOwningNode(XPathFragment xPathFragment) {
  if(isMarshalNodeValue()) {
    if (xmlCollectionReferenceMapping.usesSingleNode()) {
      return xPathFragment.nameIsText() || xPathFragment.isAttribute();
    }
    XPathFragment nextFragment = xPathFragment.getNextFragment();
    return (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
  }
  return super.isOwningNode(xPathFragment);
}

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

/**
 * Indicate if the next XPathFragment is an attribute or text() node.
 */
public boolean isOwningNode(XPathFragment xPathFragment) {
  if(isMarshalNodeValue()) {
    if (xmlCollectionReferenceMapping.usesSingleNode()) {
      return xPathFragment.nameIsText() || xPathFragment.isAttribute();
    }
    XPathFragment nextFragment = xPathFragment.getNextFragment();
    return (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
  }
  return super.isOwningNode(xPathFragment);
}

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

public void xPathNode(XPathNode xPathNode, NullCapableValue nullCapableValue) {
  // isset optional only
  if (!(isNullRepresentedByXsiNil() || marshalNullRepresentation == XMLNullRepresentationType.XSI_NIL)) {
    if (xPathNode.getXPathFragment().isAttribute()) {
      return;
    }
  }
  // get the parent above the text() node
  XPathNode parentNode = xPathNode.getParent();
  parentNode.setNullCapableValue(nullCapableValue);
}

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

public void xPathNode(XPathNode xPathNode, NullCapableValue nullCapableValue) {
  // isset optional only    	
  if (!(isNullRepresentedByXsiNil() || marshalNullRepresentation == XMLNullRepresentationType.XSI_NIL)) {
    if (xPathNode.getXPathFragment().isAttribute()) {
      return;
    }
  }
  // get the parent above the text() node    	
  XPathNode parentNode = xPathNode.getParent();
  parentNode.setNullCapableValue(nullCapableValue);
}

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

/**
 * Marshal the attribute for the predicate if one was specified.
 */
public void predicateAttribute(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) {
  if(null != xPathFragment) {
    XPathPredicate predicate = xPathFragment.getPredicate();
    if(null != predicate) {
      XPathFragment predicateXPathFragment = predicate.getXPathFragment();
      if(predicateXPathFragment.isAttribute()) {
        attribute(predicateXPathFragment, namespaceResolver, predicate.getValue());
      }
    }
  }
}

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

private String resolveNamespacePrefix(XPathFragment fragment, NamespaceResolver namespaceResolver) {
  try {
    if (fragment.getNamespaceURI() != null) {
      return fragment.getNamespaceURI();
    }
    if(fragment.getPrefix() == null && fragment.isAttribute()) {
      return null;
    }
    return namespaceResolver.resolveNamespacePrefix(fragment.getPrefix());
  } catch (Exception e) {
    return null;
  }
}

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

public void writeSingleValue(Object attributeValue, Object parent, XMLRecord row, AbstractSession session) {
  if (((XMLField)this.getField()).getLastXPathFragment().isAttribute()) {
    if (attributeValue instanceof Attr) {
      attributeValue = ((Attr)attributeValue).getValue();
    }
  } else if (((XMLField)this.getField()).getLastXPathFragment().nameIsText()) {
    if (attributeValue instanceof Text) {
      attributeValue = ((Text)attributeValue).getNodeValue();
    }
  }
  row.put(getField(), attributeValue);
}

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

public void writeSingleValue(Object attributeValue, Object parent, XMLRecord row, AbstractSession session) {
  if (((XMLField)this.getField()).getLastXPathFragment().isAttribute()) {
    if (attributeValue instanceof Attr) {
      attributeValue = ((Attr)attributeValue).getValue();
    }
  } else if (((XMLField)this.getField()).getLastXPathFragment().nameIsText()) {
    if (attributeValue instanceof Text) {
      attributeValue = ((Text)attributeValue).getNodeValue();
    }
  }
  row.put(getField(), attributeValue);
}

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

public void writeSingleValue(Object attributeValue, Object parent, XMLRecord row, AbstractSession session) {
  if (((XMLField)this.getField()).getLastXPathFragment().isAttribute()) {
    if (attributeValue instanceof Attr) {
      attributeValue = ((Attr)attributeValue).getValue();
    }
  } else if (((XMLField)this.getField()).getLastXPathFragment().nameIsText()) {
    if (attributeValue instanceof Text) {
      attributeValue = ((Text)attributeValue).getNodeValue();
    }
  }
  row.put(getField(), attributeValue);
}

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

public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) {
  unmarshalRecord.removeNullCapableValue(this);
  XPathFragment lastFrag = ((Field)xmlFragmentMapping.getField()).getLastXPathFragment();
  SAXFragmentBuilder builder = unmarshalRecord.getFragmentBuilder();
  if (lastFrag.nameIsText()) {
    Object attributeValue = builder.buildTextNode(unmarshalRecord.getCharacters().toString());
    unmarshalRecord.resetStringBuffer();
    xmlFragmentMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), attributeValue);
  } else if (!lastFrag.isAttribute()) {
    Object value = builder.getNodes().remove(builder.getNodes().size() -1);
    unmarshalRecord.setAttributeValue(value, xmlFragmentMapping);
  }
}

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

public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) {
  unmarshalRecord.removeNullCapableValue(this);
  XPathFragment lastFrag = ((XMLField)xmlFragmentMapping.getField()).getLastXPathFragment();
  SAXFragmentBuilder builder = unmarshalRecord.getFragmentBuilder();
  if (lastFrag.nameIsText()) {
    Object attributeValue = builder.buildTextNode(unmarshalRecord.getStringBuffer().toString());
    unmarshalRecord.resetStringBuffer();
    xmlFragmentMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), attributeValue);
  } else if (!lastFrag.isAttribute()) {
    Object value = builder.getNodes().remove(builder.getNodes().size() -1);
    unmarshalRecord.setAttributeValue(value, xmlFragmentMapping);
  }
}

代码示例来源: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);
}

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