hydra-jsonld/src/main/java/de/escalon/hypermedia/hydra/serialize/LdContextFactory.java
public String getVocab(MixinSource mixinSource, Object bean, Class<?> mixInClass) {
        if (proxyUnwrapper != null) {
            bean = proxyUnwrapper.unwrapProxy(bean);
        }

        // determine vocab in context
        String classVocab = bean == null ? null : vocabFromClassOrPackage(bean.getClass());

        final Vocab mixinVocab = findAnnotation(mixInClass, Vocab.class);

        Object nestedContextProviderFromMixin = getNestedContextProviderFromMixin(mixinSource, bean, mixInClass);
        String contextProviderVocab = null;
        if (nestedContextProviderFromMixin != null) {
            contextProviderVocab = getVocab(mixinSource, nestedContextProviderFromMixin, null);
        }

        String vocab;
        if (mixinVocab != null) {
            vocab = mixinVocab.value(); // wins over class
        } else if (classVocab != null) {
            vocab = classVocab; // wins over context provider
        } else if (contextProviderVocab != null) {
            vocab = contextProviderVocab; // wins over last resort
        } else {
            vocab = HTTP_SCHEMA_ORG;
        }
        return vocab;
    }
public String getVocab(MixinSource mixinSource, Object bean, Class<?> mixInClass) {
        if (proxyUnwrapper != null) {
            bean = proxyUnwrapper.unwrapProxy(bean);
        }

        // determine vocab in context
        String classVocab = bean == null ? null : vocabFromClassOrPackage(bean.getClass());

        final Vocab mixinVocab = findAnnotation(mixInClass, Vocab.class);

        Object nestedContextProviderFromMixin = getNestedContextProviderFromMixin(mixinSource, bean, mixInClass);
        String contextProviderVocab = null;
        if (nestedContextProviderFromMixin != null) {
            contextProviderVocab = getVocab(mixinSource, nestedContextProviderFromMixin, null);
        }

        String vocab;
        if (mixinVocab != null) {
            vocab = mixinVocab.value(); // wins over class
        } else if (classVocab != null) {
            vocab = classVocab; // wins over context provider
        } else if (contextProviderVocab != null) {
            vocab = contextProviderVocab; // wins over last resort
        } else {
            vocab = HTTP_SCHEMA_ORG;
        }
        return vocab;
    }
public String getVocab ( MixinSource mixinSource , Object bean , Class < ? > mixInClass ) { if ( proxyUnwrapper != null ) { bean = proxyUnwrapper . unwrapProxy ( bean ) ; } // determine vocab in context String classVocab = bean == null ? null : vocabFromClassOrPackage ( bean . getClass ( ) ) ; final Vocab mixinVocab = findAnnotation ( mixInClass , Vocab . class ) ; Object nestedContextProviderFromMixin = getNestedContextProviderFromMixin ( mixinSource , bean , mixInClass ) ; String contextProviderVocab = null ; if ( nestedContextProviderFromMixin != null ) { contextProviderVocab = getVocab ( mixinSource , nestedContextProviderFromMixin , null ) ; } String vocab ; if ( mixinVocab != null ) { vocab = mixinVocab . value ( ) ; // wins over class } else if ( classVocab != null ) { vocab = classVocab ; // wins over context provider } else if ( contextProviderVocab != null ) { vocab = contextProviderVocab ; // wins over last resort } else { vocab = HTTP_SCHEMA_ORG ; } return vocab ; }
Gets vocab for given bean.

@param bean
to inspect for vocab
@param mixInClass
for bean which might define a vocab or has a context provider
@return explicitly defined vocab or http://schema.org
Gets vocab for given bean .