gpt4 book ai didi

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

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

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

XMLConversionManager.getDefaultXMLManager介绍

暂无

代码示例

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

/**
* INTERNAL
* Return the class for a given qualified XML Schema type
* @param qname The qualified name of the XML Schema type to use as a key in the lookup
* @return The class corresponding to the specified schema type, if no corresponding match found returns null
*/
public Class getJavaClass(QName qname) {
  return getJavaClass(qname, XMLConversionManager.getDefaultXMLManager());
}

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

/**
 * Return the qualified XML Schema type for a given class
 * @param javaClass The class to use as a key in the lookup
 * @return QName The qualified XML Schema type, if no corresponding match found returns null
 */
public QName getXMLType(Class javaClass) {
  return getXMLType(javaClass, XMLConversionManager.getDefaultXMLManager());
}

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

public ConversionManager getConversionManager() {
  // Lazy init for serialization.
  if (conversionManager == null) {
    //Clone the default to allow customers to easily override the conversion manager
    conversionManager = (XMLConversionManager)XMLConversionManager.getDefaultXMLManager().clone();
  }
  return conversionManager;
}

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

public ConversionManager getConversionManager() {
  // Lazy init for serialization.
  if (conversionManager == null) {
    //Clone the default to allow customers to easily override the conversion manager
    conversionManager = (XMLConversionManager)XMLConversionManager.getDefaultXMLManager().clone();
  }
  return conversionManager;
}

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

/**
 * Return the class for a given qualified XML Schema type.
 * If the class is a primitive the corresponding wrapper class is returned
 * @param qname The qualified name of the XML Schema type to use as a key in the lookup
 * @return The class associated with the specified schema type, if no corresponding match found returns null
 */
@Override
public Class getJavaClass(QName qname) {
  return getJavaClass(qname, XMLConversionManager.getDefaultXMLManager());
}

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

/**
 * Return the class for a given qualified XML Schema type.
 * If the class is a primitive the corresponding wrapper class is returned
 * @param qname The qualified name of the XML Schema type to use as a key in the lookup
 * @return The class associated with the specified schema type, if no corresponding match found returns null
 */
@Override
public Class getJavaClass(QName qname) {
  return getJavaClass(qname, XMLConversionManager.getDefaultXMLManager());
}

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

/**
 * Return the qualified XML Schema type for a given class
 * @param javaClass The class to use as a key in the lookup
 * @return QName The qualified XML Schema type, if no corresponding match found returns null
 */
public QName getXMLType(Class javaClass) {
  return getXMLType(javaClass, XMLConversionManager.getDefaultXMLManager());
}

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

public ConversionManager getConversionManager() {
  // Lazy init for serialization.
  if (conversionManager == null) {
    //Clone the default to allow customers to easily override the conversion manager
    conversionManager = (XMLConversionManager)XMLConversionManager.getDefaultXMLManager().clone();
  }
  return conversionManager;
}

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

/**
* INTERNAL
* Return the class for a given qualified XML Schema type
* @param qname The qualified name of the XML Schema type to use as a key in the lookup
* @return The class corresponding to the specified schema type, if no corresponding match found returns null
*/
public Class getJavaClass(QName qname) {
  return getJavaClass(qname, XMLConversionManager.getDefaultXMLManager());
}

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

@Override
  public void setAttributeValueInObject(Object object, Object value) throws DescriptorException {
    // Convert the collection of Strings to an array of Object values (round-trip)
    if(value instanceof Collection) {
      int i = 0;
      Object[] parameters = new Object[((Collection)value).size()];
      for(Iterator anIterator = ((Collection)value).iterator(); anIterator.hasNext();) {
         // Lookup the object type via the predefined parameterTypes array and convert based on that type
         parameters[i] = XMLConversionManager.getDefaultXMLManager().convertObject(//
             anIterator.next(), ((IsSetNullPolicy)object).getIsSetParameterTypes()[i++]);
      }
      ((IsSetNullPolicy)object).setIsSetParameters(parameters);
    } else {
      // Cast to object array
      ((IsSetNullPolicy)object).setIsSetParameters((Object[])value);
    }
  }
}

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

@Override
  public void setAttributeValueInObject(Object object, Object value) throws DescriptorException {
    // Convert the collection of Strings to an array of Object values (round-trip)
    if(value instanceof Collection) {
      int i = 0;
      Object[] parameters = new Object[((Collection)value).size()];
      for(Iterator anIterator = ((Collection)value).iterator(); anIterator.hasNext();) {
         // Lookup the object type via the predefined parameterTypes array and convert based on that type
         parameters[i] = XMLConversionManager.getDefaultXMLManager().convertObject(//
             anIterator.next(), ((IsSetNullPolicy)object).getIsSetParameterTypes()[i++]);
      }
      ((IsSetNullPolicy)object).setIsSetParameters(parameters);
    } else {
      // Cast to object array
      ((IsSetNullPolicy)object).setIsSetParameters((Object[])value);
    }
  }
}

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

@Override
  public void setAttributeValueInObject(Object object, Object value) throws DescriptorException {
    // Convert the collection of Strings to an array of Object values (round-trip)
    if(value instanceof Collection) {
      int i = 0;
      Object[] parameters = new Object[((Collection)value).size()];
      for(Iterator anIterator = ((Collection)value).iterator(); anIterator.hasNext();) {
         // Lookup the object type via the predefined parameterTypes array and convert based on that type
         parameters[i] = XMLConversionManager.getDefaultXMLManager().convertObject(//
             anIterator.next(), ((IsSetNullPolicy)object).getIsSetParameterTypes()[i++]);
      }
      ((IsSetNullPolicy)object).setIsSetParameters(parameters);
    } else {
      // Cast to object array
      ((IsSetNullPolicy)object).setIsSetParameters((Object[])value);
    }
  }
}

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

private Map<Object, Object> createUserPropertiesMap(XmlProperty[] properties) {
  Map<Object, Object> propMap = new HashMap<Object, Object>();
  for (XmlProperty prop : properties) {
    Object pvalue = prop.value();
    if (!(prop.valueType() == String.class)) {
      pvalue = XMLConversionManager.getDefaultXMLManager().convertObject(prop.value(), prop.valueType());
    }
    propMap.put(prop.name(), pvalue);
  }
  return propMap;
}

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

private Map<Object, Object> createUserPropertiesMap(XmlProperty[] properties) {
  Map<Object, Object> propMap = new HashMap<Object, Object>();
  for (XmlProperty prop : properties) {
    Object pvalue = prop.value();
    if (!(prop.valueType() == String.class)) {
      pvalue = XMLConversionManager.getDefaultXMLManager().convertObject(prop.value(), prop.valueType());
    }
    propMap.put(prop.name(), pvalue);
  }
  return propMap;
}

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

public void setAttributeValueInObject(Object object, Object value) throws DescriptorException {
  // PERF: Direct variable access.
  if(isWriteOnly()) {
    return;
  }
  try {
    if(value == XMLRecord.noEntry) {
      return;
    }
    if (value != null && value instanceof String) {
      if(isCollapsingStringValues) {
        value = XMLConversionManager.getDefaultXMLManager().collapseStringValue((String)value);
      } else if(isNormalizingStringValues) {
        value = XMLConversionManager.getDefaultXMLManager().normalizeStringValue((String)value);
      }
    }
    this.attributeAccessor.setAttributeValueInObject(object, value);
  } catch (DescriptorException exception) {
    exception.setMapping(this);
    throw exception;
  }
}

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

/**
   * The platform holds its own instance of conversion manager to allow customization.
   */
  public ConversionManager getConversionManager() {
    // For XML we need an XMLConversionManager instance
    if (isDOMRecordSupported()) {
      // Lazy init for serialization.
      if (xmlConversionManager == null) {
        // Clone the default to allow customers to easily override the conversion manager
        xmlConversionManager = (XMLConversionManager) XMLConversionManager.getDefaultXMLManager().clone();
      }
      return xmlConversionManager;
    }
    // For non-XML, return the ConversionManager instance from DatasourcePlatform
    return super.getConversionManager();
  }
}

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

private void addChoiceElementMapping(XMLField xmlField, String className){
      
   if (xmlField.getLastXPathFragment().nameIsText()) {
     XMLDirectMapping xmlMapping = new XMLDirectMapping();
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
     xmlMapping.setAttributeClassification(theClass);
     xmlMapping.setField(xmlField);
     this.choiceElementMappings.put(xmlField, xmlMapping);
        } else {
     XMLCompositeObjectMapping xmlMapping = new XMLCompositeObjectMapping();
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     if(!className.equals("java.lang.Object")){
       xmlMapping.setReferenceClassName(className);
     }            
     xmlMapping.setField(xmlField);          
     this.choiceElementMappings.put(xmlField, xmlMapping);            
   }   
}

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

private void addChoiceElementMapping(XMLField xmlField, String className){              
   if (xmlField.getLastXPathFragment().nameIsText()) {
     XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();             
     Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
     xmlMapping.setAttributeElementClass(theClass);             
     xmlMapping.setField(xmlField);             
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     this.choiceElementMappings.put(xmlField, xmlMapping);                
   } else {
     XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();  
     if(!className.equals("java.lang.Object")){
      xmlMapping.setReferenceClassName(className);
     }      
     xmlMapping.setField(xmlField);
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     this.choiceElementMappings.put(xmlField, xmlMapping);                
   }        
}

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

/**
 * The platform holds its own instance of conversion manager to allow customization.
 */
public ConversionManager getConversionManager() {
  // For XML we need an XMLConversionManager instance
  if (isDOMRecordSupported()) {
    // Lazy init for serialization.
    if (xmlConversionManager == null) {
      // Clone the default to allow customers to easily override the conversion manager
      xmlConversionManager = (XMLConversionManager) XMLConversionManager.getDefaultXMLManager().clone();
      xmlConversionManager.setLoader(super.getConversionManager().getLoader());
    }
    return xmlConversionManager;
  }
  // For non-XML, return the ConversionManager instance from DatasourcePlatform
  return super.getConversionManager();
}

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

/**
 * The platform holds its own instance of conversion manager to allow customization.
 */
public ConversionManager getConversionManager() {
  // For XML we need an XMLConversionManager instance
  if (isDOMRecordSupported()) {
    // Lazy init for serialization.
    if (xmlConversionManager == null) {
      // Clone the default to allow customers to easily override the conversion manager
      xmlConversionManager = (XMLConversionManager) XMLConversionManager.getDefaultXMLManager().clone();
      xmlConversionManager.setLoader(super.getConversionManager().getLoader());
    }
    return xmlConversionManager;
  }
  // For non-XML, return the ConversionManager instance from DatasourcePlatform
  return super.getConversionManager();
}

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