Package org.lightadmin.api.config.utils

Examples of org.lightadmin.api.config.utils.EntityNameExtractor


@SuppressWarnings("unchecked")
public class EntityNameExtractorFactoryTest {

    @Test
    public void namedEntityNameExtraction() throws Exception {
        final EntityNameExtractor entityNameExtractor = forNamedPersistentEntity("name");

        assertEquals("Domain Type Object Name", entityNameExtractor.apply(new DomainType()));
    }
View Full Code Here


        assertEquals("Domain Type Object Name", configurationUnit.getNameExtractor().apply(new DomainType()));
    }

    @Test
    public void configurationWithNameExtractorCreated() throws Exception {
        final EntityNameExtractor expectedEntityNameExtractor = EasyMock.createNiceMock(EntityNameExtractor.class);

        final EntityMetadataConfigurationUnit configurationUnit = configurationBuilder()
                .nameExtractor(expectedEntityNameExtractor)
                .build();
View Full Code Here

public class NamingUtils {

    @SuppressWarnings("unchecked")
    public static String entityName(DomainTypeAdministrationConfiguration domainTypeAdministrationConfiguration, Object entity) {
        final EntityNameExtractor nameExtractor = domainTypeAdministrationConfiguration.getEntityConfiguration().getNameExtractor();

        return exceptionAwareNameExtractor(nameExtractor, domainTypeAdministrationConfiguration).apply(entity);
    }
View Full Code Here

        return persistentEntity.getIdProperty().getName();
    }

    private String stringRepresentation(Object value, PersistentEntity persistentEntity) {
        DomainTypeBasicConfiguration domainTypeBasicConfiguration = adminConfiguration.forDomainType(persistentEntity.getType());
        EntityNameExtractor nameExtractor = domainTypeBasicConfiguration.getEntityConfiguration().getNameExtractor();

        return exceptionAwareNameExtractor(nameExtractor, domainTypeBasicConfiguration).apply(value);
    }
View Full Code Here

TOP

Related Classes of org.lightadmin.api.config.utils.EntityNameExtractor

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.