Package org.eclipse.persistence.mappings.converters

Examples of org.eclipse.persistence.mappings.converters.EnumTypeConverter


        this.dcl = dcl;
    }

    public void addEnumLiteral(String literalLabel) {
        dcl.addEnum(className, literalLabel);
        EnumTypeConverter converter = (EnumTypeConverter)adm.getConverter();
        converter.addConversionValue(literalLabel, literalLabel);
    }
View Full Code Here


        EnumTypeConverter converter = (EnumTypeConverter)adm.getConverter();
        converter.addConversionValue(literalLabel, literalLabel);
    }
   
    public Enum getEnum() {
        EnumTypeConverter converter = (EnumTypeConverter)adm.getConverter();
        converter.convertClassNamesToClasses(dcl);
        Class enumClass = converter.getEnumClass();
        String literalLabel = (String)converter.getAttributeToFieldValues().
            keySet().iterator().next();
        return Enum.valueOf(enumClass, literalLabel);
    }
View Full Code Here

        MetadataClass dataType = getDataType(accessor, referenceClass);
        MetadataClass objectType = getObjectType(accessor, referenceClass);
       
        if (objectType.isEnum()) {
            // Create an EnumTypeConverter.
            converter = new EnumTypeConverter(mapping, objectType.getName());
           
            // The object values should be the names of the enum members so
            // force the objectType to String to ensure the initObject calls
            // below will work.
            objectType = getMetadataFactory().getMetadataClass(String.class.getName());
View Full Code Here

        }
        boolean isOrdinal = true;
        if (m_enumerated != null) {
            isOrdinal = m_enumerated.equals(EnumType.ORDINAL.name());
        }
        setConverter(mapping, new EnumTypeConverter(mapping, getJavaClass(referenceClass), isOrdinal), isForMapKey);
    }
View Full Code Here

        XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
        keepAsElementMapping.setAttributeName("keepAsElementPolicy");
        keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
        keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
        keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
        EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
        keepAsElementMapping.setConverter(converter);
        descriptor.addMapping(keepAsElementMapping);

        return descriptor;
    }
View Full Code Here

         XMLDirectMapping nrfxMapping = new XMLDirectMapping();
         nrfxMapping.setAttributeName("marshalNullRepresentation");
         nrfxMapping.setXPath(getPrimaryNamespaceXPath() + "null-representation-for-xml/text()");
         // Restricted to XSI_NIL,ABSENT_NODE,EMPTY_NODE
         EnumTypeConverter aConverter = new EnumTypeConverter(nrfxMapping, XMLNullRepresentationType.class, false);
         nrfxMapping.setConverter(aConverter);
         aDescriptor.addMapping(nrfxMapping);

         // Subclasses
         aDescriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("@xsi:type"));
View Full Code Here

         descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);

         XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
         wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
         wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
         EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter(
             wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false);
         wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter);
         descriptor.addMapping(wrappedDatabaseTypeMapping);

         return descriptor;
View Full Code Here

         descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);

         XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
         wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
         wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
         EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter(
             wrappedDatabaseTypeMapping, JDBCTypes.class, false);
         wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter);
         descriptor.addMapping(wrappedDatabaseTypeMapping);

         return descriptor;
View Full Code Here

        XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
        keepAsElementMapping.setAttributeName("keepAsElementPolicy");
        keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
        keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
        keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
        EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
        keepAsElementMapping.setConverter(converter);
        descriptor.addMapping(keepAsElementMapping);

        return descriptor;
    }
View Full Code Here

        XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
        keepAsElementMapping.setAttributeName("keepAsElementPolicy");
        keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
        keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
        keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
        EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
        keepAsElementMapping.setConverter(converter);
        descriptor.addMapping(keepAsElementMapping);

        XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
        reuseContainerMapping.setAttributeName("reuseContainer");
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.mappings.converters.EnumTypeConverter

Copyright © 2018 www.massapicom. 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.