/** * 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()); }
/** * 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()); }
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; }
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; }
/** * 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()); }
/** * 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()); }
/** * 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()); }
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; }
/** * 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()); }
@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); } } }
@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); } } }
@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); } } }
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; }
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; }
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; } }
/** * 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(); } }
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); } }
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); } }
/** * 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(); }
/** * 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(); }