Example usage for com.liferay.portal.repository.registry RepositoryClassDefinitionCatalogUtil getRepositoryClassDefinitionCatalog

List of usage examples for com.liferay.portal.repository.registry RepositoryClassDefinitionCatalogUtil getRepositoryClassDefinitionCatalog

Introduction

In this page you can find the example usage for com.liferay.portal.repository.registry RepositoryClassDefinitionCatalogUtil getRepositoryClassDefinitionCatalog.

Prototype

public static RepositoryClassDefinitionCatalog getRepositoryClassDefinitionCatalog() 

Source Link

Usage

From source file:com.liferay.adaptive.media.document.library.internal.repository.BaseOverridingRepositoryDefiner.java

License:Open Source License

private <T> T _getFieldValue(String fieldName) {
    try {/*  w  w w.  j  av a 2s.c  o  m*/
        RepositoryClassDefinitionCatalog repositoryClassDefinitionCatalog = RepositoryClassDefinitionCatalogUtil
                .getRepositoryClassDefinitionCatalog();

        Class<? extends RepositoryClassDefinitionCatalog> clazz = repositoryClassDefinitionCatalog.getClass();

        Field field = clazz.getDeclaredField(fieldName);

        field.setAccessible(true);

        return (T) field.get(repositoryClassDefinitionCatalog);
    } catch (IllegalAccessException | NoSuchFieldException | SecurityException e) {

        throw new RepositoryException(e);
    }
}