gpt4 book ai didi

org.eclipse.persistence.oxm.schema.XMLSchemaReference.getSchemaContext()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 23:16:40 28 4
gpt4 key购买 nike

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

XMLSchemaReference.getSchemaContext介绍

[英]Get the path to the simple/complex type definition, element or group to be referenced in the schema
[中]获取架构中要引用的简单/复杂类型定义、元素或组的路径

代码示例

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

protected void addTypeAttributeIfNeeded(XMLDescriptor descriptor, DatabaseMapping mapping, MarshalRecord marshalRecord) {
  XMLSchemaReference xmlRef = descriptor.getSchemaReference();
  if (xmlCompositeCollectionMapping.shouldAddXsiType(marshalRecord, descriptor) && (xmlRef != null)) {
    addTypeAttribute(descriptor, marshalRecord, xmlRef.getSchemaContext());
  }
}

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

private void writeTypeAttribute(MarshalRecord marshalRecord, XMLDescriptor descriptor, String xsiPrefix) {
  //xsi:type=schemacontext
  String typeValue = descriptor.getSchemaReference().getSchemaContext();
  // handle case where the schema context is set as a QName
  if (typeValue == null) {
    QName contextAsQName = descriptor.getSchemaReference().getSchemaContextAsQName();
    if (contextAsQName == null) {
      return;
    }
    String uri = contextAsQName.getNamespaceURI();
    String localPart = contextAsQName.getLocalPart();
    String prefix = marshalRecord.getNamespaceResolver().resolveNamespaceURI(uri);
    if (prefix == null) {
      String defaultUri = marshalRecord.getNamespaceResolver().getDefaultNamespaceURI();
      if (defaultUri != null && defaultUri.equals(uri)) {
        typeValue = localPart;
      } else {
        prefix = marshalRecord.getNamespaceResolver().generatePrefix();
        marshalRecord.attribute(XMLConstants.XMLNS_URL, prefix, XMLConstants.XMLNS + XMLConstants.COLON + prefix, uri);
        typeValue = prefix + XMLConstants.COLON + localPart;
      }
    } else {
      typeValue = prefix + XMLConstants.COLON + localPart;
    }
  } else {
    typeValue = typeValue.substring(1);
  }
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_TYPE_ATTRIBUTE, xsiPrefix + XMLConstants.COLON + XMLConstants.SCHEMA_TYPE_ATTRIBUTE, typeValue);
}

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

String schemaContext = xmlSchemaReference.getSchemaContext();
if ((xmlSchemaReference.getType() == XMLSchemaReference.COMPLEX_TYPE) || (xmlSchemaReference.getType() == XMLSchemaReference.SIMPLE_TYPE)) {
  if ((null != schemaContext) && (schemaContext.lastIndexOf('/') == 0)) {

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

protected void addTypeAttributeIfNeeded(XMLDescriptor descriptor, DatabaseMapping mapping, MarshalRecord marshalRecord) {
  XMLSchemaReference xmlRef = descriptor.getSchemaReference();
  if (xmlCompositeObjectMapping.shouldAddXsiType(marshalRecord, descriptor) && (xmlRef != null)) {
    addTypeAttribute(descriptor, marshalRecord, xmlRef.getSchemaContext());
  }
}

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

String schemaContext = xmlSchemaReference.getSchemaContext();
if ((xmlSchemaReference.getType() == XMLSchemaReference.COMPLEX_TYPE) || (xmlSchemaReference.getType() == XMLSchemaReference.SIMPLE_TYPE)) {
  if ((null != schemaContext) && (schemaContext.lastIndexOf('/') == 0)) {

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

/**
 * <p>INTERNAL:
 */
@SuppressWarnings("rawtypes")
public void buildDescriptorIndex() {
  for (Iterator i = xrService.oxSession.getProject().getOrderedDescriptors().iterator();
    i.hasNext();) {
    XMLDescriptor xd = (XMLDescriptor)i.next();
    XMLSchemaReference schemaReference = xd.getSchemaReference();
    if (schemaReference != null && schemaReference.getType() == XMLSchemaReference.COMPLEX_TYPE) {
      String context = schemaReference.getSchemaContext();
      if (context != null && context.lastIndexOf(SLASH_CHAR) == 0) {
        String elementNameNS = context.substring(1);
        QName elementName = resolveName(elementNameNS, xd.getNamespaceResolver());
        if (elementName == null) {
          continue;
        }
        xrService.descriptorsByQName.put(elementName, xd);
      }
    }
  }
}

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

String schemaContext = xmlSchemaReference.getSchemaContext();
if ((xmlSchemaReference.getType() == XMLSchemaReference.COMPLEX_TYPE) || (xmlSchemaReference.getType() == XMLSchemaReference.SIMPLE_TYPE)) {
  if ((null != schemaContext) && (schemaContext.lastIndexOf('/') == 0)) {

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

/**
 * <p>INTERNAL:
 */
@SuppressWarnings("rawtypes")
public void buildDescriptorIndex() {
  for (Iterator i = xrService.oxSession.getProject().getOrderedDescriptors().iterator();
    i.hasNext();) {
    XMLDescriptor xd = (XMLDescriptor)i.next();
    XMLSchemaReference schemaReference = xd.getSchemaReference();
    if (schemaReference != null && schemaReference.getType() == XMLSchemaReference.COMPLEX_TYPE) {
      String context = schemaReference.getSchemaContext();
      if (context != null && context.lastIndexOf(SLASH_CHAR) == 0) {
        String elementNameNS = context.substring(1);
        QName elementName = resolveName(elementNameNS, xd.getNamespaceResolver());
        if (elementName == null) {
          continue;
        }
        xrService.descriptorsByQName.put(elementName, xd);
      }
    }
  }
}

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

return true;
} else if (((xmlRef.getType() == XMLSchemaReference.COMPLEX_TYPE) || (xmlRef.getType() == XMLSchemaReference.SIMPLE_TYPE)) && xmlRef.getSchemaContext() != null && xmlRef.isGlobalDefinition()) {
  QName ctxQName = xmlRef.getSchemaContextAsQName(descriptor.getNamespaceResolver());
  if (!ctxQName.equals(leafType)) {

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

String value = xmlDescriptor.getSchemaReference().getSchemaContext();
String value = xmlDescriptor.getSchemaReference().getSchemaContext();
typeAttr.setValue(value);

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

return true;
} else if (((xmlRef.getType() == XMLSchemaReference.COMPLEX_TYPE) || (xmlRef.getType() == XMLSchemaReference.SIMPLE_TYPE)) && xmlRef.getSchemaContext() != null && xmlRef.isGlobalDefinition()) {
  QName ctxQName = xmlRef.getSchemaContextAsQName(descriptor.getNamespaceResolver());
  if (!ctxQName.equals(leafType)) {

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

String value = xmlDescriptor.getSchemaReference().getSchemaContext();
String value = xmlDescriptor.getSchemaReference().getSchemaContext();
typeAttr.setValue(value);

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

marshalRecord.put(xmlField, xmlRef.getSchemaContext().substring(1));
  marshalRecord.closeStartGroupingElements(groupingFragment);
} else {
  marshalRecord.closeStartGroupingElements(groupingFragment);
  marshalRecord.put(xmlField, xmlRef.getSchemaContext().substring(1));

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

if (writeTypeAttribute && (descriptor.getSchemaReference() != null) && (descriptor.getSchemaReference().getSchemaContext() != null)) {
  ((Element) xmlRow.getDOM()).setAttributeNS(XMLConstants.XMLNS_URL, XMLConstants.XMLNS + XMLConstants.COLON + XMLConstants.SCHEMA_INSTANCE_PREFIX, XMLConstants.SCHEMA_INSTANCE_URL);
  String typeValue = descriptor.getSchemaReference().getSchemaContext();
  typeValue = typeValue.substring(1);

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

String schemaContext = ((SDOType)value.getType()).getXmlDescriptor().getSchemaReference().getSchemaContext();
QName schemaContextQName = ((SDOType)value.getType()).getXmlDescriptor().getSchemaReference().getSchemaContextAsQName(((SDOType)value.getType()).getXmlDescriptor().getNonNullNamespaceResolver());

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

String typeValue = descriptor.getSchemaReference().getSchemaContext();
addTypeAttribute(descriptor, marshalRecord, typeValue);

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

String schemaContext = ((SDOType)value.getType()).getXmlDescriptor().getSchemaReference().getSchemaContext();
QName schemaContextQName = ((SDOType)value.getType()).getXmlDescriptor().getSchemaReference().getSchemaContextAsQName(((SDOType)value.getType()).getXmlDescriptor().getNonNullNamespaceResolver());

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

if (superDescriptor != null) {
  XMLSchemaReference sRef = descriptor.getSchemaReference();
  if (sRef == null || sRef.getSchemaContext() == null) {
    return;
    } else {
      XMLSchemaReference rootSRef = rootDescriptor.getSchemaReference();
      if (rootSRef != null && rootSRef.getSchemaContext() != null) {
        QName rootSCtx = rootSRef.getSchemaContextAsQName();
        rootDescriptor.getInheritancePolicy().addClassNameIndicator(rootDescriptor.getJavaClassName(), rootSCtx);

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

writeXsiTypeAttribute(xmlDescriptor, (DOMRecord)record, xmlRef.getSchemaContext().substring(1));
      writeXsiTypeAttribute(xmlDescriptor, (DOMRecord)record, xmlRef.getSchemaContext().substring(1));
    } else {
      writeXsiTypeAttribute(xmlDescriptor, (DOMRecord)record, xmlRef.getSchemaContext().substring(1));

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

if (!ctx.equals(xmlDescriptor.getDefaultRootElementType())) {
  row.add(xmlDescriptor.getInheritancePolicy().getClassIndicatorField(), xmlRef.getSchemaContext().substring(1));

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