/** * Retrieves a PropertyAccessor instance based on the given property definition and * entity mode. * * @param property The property for which to retrieve an accessor. * @param mode The mode for the resulting entity. * @return An appropriate accessor. * @throws MappingException */ public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException { //TODO: this is temporary in that the end result will probably not take a Property reference per-se. if ( null == mode || EntityMode.POJO.equals( mode ) ) { return getPojoPropertyAccessor( property.getPropertyAccessorName() ); } else if ( EntityMode.MAP.equals( mode ) ) { return getDynamicMapPropertyAccessor(); } else if ( EntityMode.DOM4J.equals( mode ) ) { //TODO: passing null here, because this method is not really used for DOM4J at the moment // but it is still a bug, if we don't get rid of this! return getDom4jPropertyAccessor( property.getAccessorPropertyName( mode ), property.getType(), null ); } else { throw new MappingException( "Unknown entity mode [" + mode + "]" ); } } /** * Retreives a PropertyAccessor specific for a PojoRepresentation with the given access strategy.
/** * Retrieves a PropertyAccessor instance based on the given property definition and * entity mode. * * @param property The property for which to retrieve an accessor. * @param mode The mode for the resulting entity. * @return An appropriate accessor. * @throws MappingException */ public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException { //TODO: this is temporary in that the end result will probably not take a Property reference per-se. if ( null == mode || EntityMode.POJO.equals( mode ) ) { return getPojoPropertyAccessor( property.getPropertyAccessorName() ); } else if ( EntityMode.MAP.equals( mode ) ) { return getDynamicMapPropertyAccessor(); } else if ( EntityMode.DOM4J.equals( mode ) ) { //TODO: passing null here, because this method is not really used for DOM4J at the moment // but it is still a bug, if we don't get rid of this! return getDom4jPropertyAccessor( property.getAccessorPropertyName( mode ), property.getType(), null ); } else { throw new MappingException( "Unknown entity mode [" + mode + "]" ); } } /** * Retreives a PropertyAccessor specific for a PojoRepresentation with the given access strategy.
/** * Retrieves a PropertyAccessor instance based on the given property definition and * entity mode. * * @param property The property for which to retrieve an accessor. * @param mode The mode for the resulting entity. * @return An appropriate accessor. * @throws MappingException */ public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException { //TODO: this is temporary in that the end result will probably not take a Property reference per-se. if ( null == mode || EntityMode.POJO.equals( mode ) ) { return getPojoPropertyAccessor( property.getPropertyAccessorName() ); } else if ( EntityMode.MAP.equals( mode ) ) { return getDynamicMapPropertyAccessor(); } else { throw new MappingException( "Unknown entity mode [" + mode + "]" ); } }
/** * Retrieves a PropertyAccessor instance based on the given property definition and * entity mode. * * @param property The property for which to retrieve an accessor. * @param mode The mode for the resulting entity. * @return An appropriate accessor. * @throws MappingException */ public static PropertyAccessor getPropertyAccessor(AttributeBinding property, EntityMode mode) throws MappingException { //TODO: this is temporary in that the end result will probably not take a Property reference per-se. if ( null == mode || EntityMode.POJO.equals( mode ) ) { return getPojoPropertyAccessor( property.getPropertyAccessorName() ); } else if ( EntityMode.MAP.equals( mode ) ) { return getDynamicMapPropertyAccessor(); } else { throw new MappingException( "Unknown entity mode [" + mode + "]" ); } }
/** * Retrieves a PropertyAccessor instance based on the given property definition and * entity mode. * * @param property The property for which to retrieve an accessor. * @param mode The mode for the resulting entity. * @return An appropriate accessor. * @throws MappingException */ public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException { //TODO: this is temporary in that the end result will probably not take a Property reference per-se. if ( null == mode || EntityMode.POJO.equals( mode ) ) { return getPojoPropertyAccessor( property.getPropertyAccessorName() ); } else if ( EntityMode.MAP.equals( mode ) ) { return getDynamicMapPropertyAccessor(); } else { throw new MappingException( "Unknown entity mode [" + mode + "]" ); } }
/** * Retrieves a PropertyAccessor instance based on the given property definition and * entity mode. * * @param property The property for which to retrieve an accessor. * @param mode The mode for the resulting entity. * @return An appropriate accessor. * @throws MappingException */ public static PropertyAccessor getPropertyAccessor(AttributeBinding property, EntityMode mode) throws MappingException { //TODO: this is temporary in that the end result will probably not take a Property reference per-se. if ( null == mode || EntityMode.POJO.equals( mode ) ) { return getPojoPropertyAccessor( property.getPropertyAccessorName() ); } else if ( EntityMode.MAP.equals( mode ) ) { return getDynamicMapPropertyAccessor(); } else { throw new MappingException( "Unknown entity mode [" + mode + "]" ); } }