Package org.eclipse.persistence.internal.oxm

Examples of org.eclipse.persistence.internal.oxm.ConversionManager.javaType()


                        //check to see if type attribute represents simple type
                      if(null == session) {
                         session = (CoreAbstractSession) xmlContext.getSession();
                      }
                      ConversionManager conversionManager = (ConversionManager) session.getDatasourcePlatform().getConversionManager();
                        primitiveWrapperClass = conversionManager.javaType(lookupQName);                      
                    }else{         
                      //found descriptor based on type attribute
                      xmlDescriptor = lookupDescriptor;
                      session = xmlContext.getSession(xmlDescriptor);  
                    }
View Full Code Here


        }else if(value instanceof String){
            jsonArrayBuilder.add((String)value);
        }else{
            ConversionManager conversionManager = getConversionManager();
            String convertedValue = (String) conversionManager.convertObject(value, CoreClassConstants.STRING, schemaType);
            Class theClass = conversionManager.javaType(schemaType);
            if((schemaType == null || theClass == null) && (CoreClassConstants.NUMBER.isAssignableFrom(value.getClass()))){
                //if it's still a number and falls through the cracks we dont want "" around the value
                    BigDecimal convertedNumberValue = ((BigDecimal) ((ConversionManager) session.getDatasourcePlatform().getConversionManager()).convertObject(value, CoreClassConstants.BIGDECIMAL, schemaType));
                    jsonArrayBuilder.add((BigDecimal)convertedNumberValue);
            }else{
View Full Code Here

            XPathFragment typeFragment = new XPathFragment(type);
            String namespaceURI = ((DOMRecord)nestedRow).resolveNamespacePrefix(typeFragment.getPrefix());
            typeFragment.setNamespaceURI(namespaceURI);
            QName schemaTypeQName = new QName(namespaceURI, typeFragment.getLocalName());
            ConversionManager conversionManager = (ConversionManager) executionSession.getDatasourcePlatform().getConversionManager();
            Class theClass = conversionManager.javaType(schemaTypeQName);
            if (theClass != null) {
                objectToAdd = conversionManager.convertObject(stringValue, theClass, schemaTypeQName);
            }
        }
        return objectToAdd;
View Full Code Here

        }else if(value instanceof String){
            jsonGenerator.write(keyName, (String)value);
        }else{
            ConversionManager conversionManager = getConversionManager();
            String convertedValue = (String) conversionManager.convertObject(value, CoreClassConstants.STRING, schemaType);
            Class theClass = conversionManager.javaType(schemaType);
            if((schemaType == null || theClass == null) && (CoreClassConstants.NUMBER.isAssignableFrom(value.getClass()))){
                //if it's still a number and falls through the cracks we dont want "" around the value
                    BigDecimal convertedNumberValue = ((BigDecimal) ((ConversionManager) session.getDatasourcePlatform().getConversionManager()).convertObject(value, CoreClassConstants.BIGDECIMAL, schemaType));
                    jsonGenerator.write(keyName, (BigDecimal)convertedNumberValue);
            }else{
View Full Code Here

        }else if(value instanceof String){
            jsonGenerator.write((String)value);           
        }else{
            ConversionManager conversionManager = getConversionManager();
            String convertedValue = (String) conversionManager.convertObject(value, CoreClassConstants.STRING, schemaType);
            Class theClass = conversionManager.javaType(schemaType);
            if((schemaType == null || theClass == null) && (CoreClassConstants.NUMBER.isAssignableFrom(value.getClass()))){
                //if it's still a number and falls through the cracks we dont want "" around the value
                    BigDecimal convertedNumberValue = ((BigDecimal) ((ConversionManager) session.getDatasourcePlatform().getConversionManager()).convertObject(value, CoreClassConstants.BIGDECIMAL, schemaType));
                    jsonGenerator.write((BigDecimal)convertedNumberValue);           
View Full Code Here

        }else if(value instanceof String){
            jsonObjectBuilder.add(keyName, (String)value);               
        }else{
            ConversionManager conversionManager = getConversionManager();
            String convertedValue = (String) conversionManager.convertObject(value, CoreClassConstants.STRING, schemaType);
            Class theClass = conversionManager.javaType(schemaType);
            if((schemaType == null || theClass == null) && (CoreClassConstants.NUMBER.isAssignableFrom(value.getClass()))){
                //if it's still a number and falls through the cracks we dont want "" around the value
                    BigDecimal convertedNumberValue = ((BigDecimal) ((ConversionManager) session.getDatasourcePlatform().getConversionManager()).convertObject(value, CoreClassConstants.BIGDECIMAL, schemaType));
                    jsonObjectBuilder.add(keyName, (BigDecimal)convertedNumberValue);
            }else{
View Full Code Here

            String stringValue = ((Text) textchild).getNodeValue();
            if ((stringValue != null) && stringValue.length() > 0) {
                Object convertedValue = stringValue;
                if (schemaTypeQName != null) {
                    ConversionManager conversionManager = (ConversionManager) session.getDatasourcePlatform().getConversionManager();
                    Class theClass = conversionManager.javaType(schemaTypeQName);
                    if (theClass != null) {
                        convertedValue = conversionManager.convertObject(convertedValue, theClass, schemaTypeQName);
                    }
                }
                if (converter != null) {
View Full Code Here

        }
        else if(value.getClass() == String.class){         
            //if schemaType is set and it's a numeric or boolean type don't treat as a string
            if(schemaType != null && isNumericOrBooleanType(schemaType)){
                ConversionManager conversionManager = getConversionManager();
                Class<?> theClass = conversionManager.javaType(schemaType);
                Object convertedValue = conversionManager.convertObject(value, theClass, schemaType);
                writeValue(convertedValue, schemaType, isAttribute);
            }else if(isCDATA){
                cdata((String)value);
            }else{
View Full Code Here

                 characters((String)value);
             }
        }else{
            ConversionManager conversionManager = getConversionManager();
            String convertedValue = (String) conversionManager.convertObject(value, CoreClassConstants.STRING, schemaType);
            Class theClass = conversionManager.javaType(schemaType);

            if(schemaType == null || theClass == null){
                if(value.getClass() == CoreClassConstants.BOOLEAN || CoreClassConstants.NUMBER.isAssignableFrom(value.getClass())){
                  characters(convertedValue, false, isAttribute);
                }else{
View Full Code Here

            XPathFragment typeFragment = new XPathFragment(type);
            String namespaceURI = nestedRow.resolveNamespacePrefix(typeFragment.getPrefix());

            QName schemaTypeQName = new QName(namespaceURI, typeFragment.getLocalName());
            ConversionManager conversionManager = (ConversionManager) executionSession.getDatasourcePlatform().getConversionManager();
            Class theClass = conversionManager.javaType(schemaTypeQName);
            if (theClass != null) {
                toReturn = conversionManager.convertObject(stringValue, theClass, schemaTypeQName);
            }
        }
        return toReturn;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.