gpt4 book ai didi

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

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

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

XPathFragment.getShortName介绍

暂无

代码示例

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

public void element(XPathFragment frag) {
  try {
    xmlStreamWriter.writeStartElement(frag.getShortName());
    xmlStreamWriter.writeEndElement();
  } catch(XMLStreamException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
  public void endDocument() {

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

/**
 * INTERNAL:
 */
public void element(XPathFragment frag) {
  Element element = document.createElementNS(frag.getNamespaceURI(), frag.getShortName());
  node.appendChild(element);
}

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

/**
 * INTERNAL:
 */
public void attribute(XPathFragment xPathFragment, NamespaceResolver namespaceResolver, String value) {
  if (node.getNodeType() == Node.ELEMENT_NODE) {
    getDOM().setAttributeNS(xPathFragment.getNamespaceURI(), xPathFragment.getShortName(), value);
  }
}

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

/**
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) {
  super.openStartElement(xPathFragment, namespaceResolver);
  Element element = document.createElementNS(xPathFragment.getNamespaceURI(), xPathFragment.getShortName());
  node = node.appendChild(element);
}

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

/**
 * INTERNAL:
 */
public void attribute(XPathFragment xPathFragment, NamespaceResolver namespaceResolver, String value) {
  String namespaceURI = resolveNamespacePrefix(xPathFragment, namespaceResolver);
  attributes.addAttribute(namespaceURI, xPathFragment.getLocalName(), xPathFragment.getShortName(), XMLConstants.CDATA, value);
}

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

/**
 * INTERNAL:
 */
public void attribute(XPathFragment xPathFragment, NamespaceResolver namespaceResolver, String value) {
  attribute(null, xPathFragment.getLocalName(), xPathFragment.getShortName(), value);
}

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

/**
 * INTERNAL:
 */
public void attribute(XPathFragment xPathFragment, NamespaceResolver namespaceResolver, String value) {
  attribute(null, xPathFragment.getLocalName(), xPathFragment.getShortName(), value);
}

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

/**
 * INTERNAL:
 * 
 * Create a start element tag - this call results in a complete start element, 
 * i.e. closeStartElement() does not need to be called after a call to this 
 * method.
 * 
 */
private void openAndCloseStartElement() {
  try {
    contentHandler.startElement(xPathFragment.getNamespaceURI(), xPathFragment.getLocalName(), xPathFragment.getShortName(), attributes);
  } catch (SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

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

/**
 * Build and return an Attribute for a given XPathFragment.
 *
 * @param mapping
 * @param schemaType
 * @return
 */
protected Attribute buildAttribute(XPathFragment frag, String schemaType) {
  Attribute attr = new Attribute();
  attr.setName(frag.getShortName());
  attr.setType(schemaType);
  return attr;
}

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

/**
 * Build and return an Attribute for a given XPathFragment.
 * 
 * @param mapping
 * @param schemaType
 * @return
 */
protected Attribute buildAttribute(XPathFragment frag, String schemaType) {
  Attribute attr = new Attribute();
  attr.setName(frag.getShortName());
  attr.setType(schemaType);
  return attr;
}

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

/**
 * Build and return an Attribute for a given XPathFragment.
 * 
 * @param mapping
 * @param schemaType
 * @return
 */
protected Attribute buildAttribute(XPathFragment frag, String schemaType) {
  Attribute attr = new Attribute();
  attr.setName(frag.getShortName());
  attr.setType(schemaType);
  return attr;
}

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

protected String getNameForFragment(XPathFragment xPathFragment) {
  if(!this.hasCustomNamespaceMapper()) {
    return xPathFragment.getShortName();
  }
  if(xPathFragment.getNamespaceURI() != null && xPathFragment.getNamespaceURI().length() > 0) {
    String prefix = this.getPrefixForFragment(xPathFragment);
    if(prefix != null && prefix.length() > 0) {
      return prefix + Constants.COLON + xPathFragment.getLocalName();
    }
  }
  return xPathFragment.getLocalName();
}

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

/**
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) {
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen = false;
  }
  try {
    contentHandler.endElement(xPathFragment.getNamespaceURI(), xPathFragment.getLocalName(), xPathFragment.getShortName());
    isStartElementOpen = false;
  } catch (SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

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

protected String getNameForFragment(XPathFragment xPathFragment) {
  if(!this.hasCustomNamespaceMapper()) {
    return xPathFragment.getShortName();
  }
  if(xPathFragment.getNamespaceURI() != null && xPathFragment.getNamespaceURI().length() > 0) {
    String prefix = this.getPrefixForFragment(xPathFragment);
    if(prefix != null && prefix.length() > 0) {
      return prefix + Constants.COLON + xPathFragment.getLocalName();
    }
  }
  return xPathFragment.getLocalName();
}

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

public Element createUnownedElement(Node parent, XMLField xmlField) {
  XPathFragment lastFragment = xmlField.getXPathFragment();
  while (lastFragment.getNextFragment() != null) {
    lastFragment = lastFragment.getNextFragment();
  }
  String nodeName = lastFragment.getShortName();
  String namespace = resolveNamespacePrefix(lastFragment, getNamespaceResolverForField(xmlField));
  Element elem = parent.getOwnerDocument().createElementNS(namespace, nodeName);
  if (lastFragment.isGeneratedPrefix()) {
    elem.setAttributeNS(XMLConstants.XMLNS_URL, XMLConstants.XMLNS + XMLConstants.COLON + lastFragment.getPrefix(), lastFragment.getNamespaceURI());
  }
  return elem;
}

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

/**
 * Build and return an Attribute for a given XMLDirectMapping.
 * 
 * @param mapping
 * @param schemaType
 * @return
 */
protected Attribute buildAttribute(DirectMapping mapping, String schemaType) {
  XPathFragment frag = ((Field) mapping.getField()).getXPathFragment();
  Attribute attr = new Attribute();
  attr.setName(frag.getShortName());
  attr.setType(schemaType);
  return attr;
}

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

/**
 * Build and return an Attribute for a given XMLDirectMapping.
 *
 * @param mapping
 * @param schemaType
 * @return
 */
protected Attribute buildAttribute(DirectMapping mapping, String schemaType) {
  XPathFragment frag = ((Field) mapping.getField()).getXPathFragment();
  Attribute attr = new Attribute();
  attr.setName(frag.getShortName());
  attr.setType(schemaType);
  return attr;
}

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

/**
 * Build and return an Attribute for a given XMLDirectMapping.
 * 
 * @param mapping
 * @param schemaType
 * @return
 */
protected Attribute buildAttribute(XMLDirectMapping mapping, String schemaType) {
  XPathFragment frag = ((XMLField) mapping.getField()).getXPathFragment();
  Attribute attr = new Attribute();
  attr.setName(frag.getShortName());
  attr.setType(schemaType);
  return attr;
}

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

private Setting convertToSetting(XPathFragment xPathFragment, NamespaceResolver nsResolver) {
  Setting setting = new Setting();
  String name = xPathFragment.getLocalName();
  if (null == name) {
    name = xPathFragment.getShortName();
  }
  setting.setName(name);
  if (xPathFragment.hasNamespace()) {
    setting.setNamespaceURI(nsResolver.resolveNamespacePrefix(xPathFragment.getPrefix()));
  }
  return setting;
}

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

private Setting convertToSetting(XPathFragment xPathFragment, NamespaceResolver nsResolver) {
  Setting setting = new Setting();
  String name = xPathFragment.getLocalName();
  if (null == name) {
    name = xPathFragment.getShortName();
  }
  setting.setName(name);
  if (xPathFragment.hasNamespace()) {
    setting.setNamespaceURI(nsResolver.resolveNamespacePrefix(xPathFragment.getPrefix()));
  }
  return setting;
}

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