Package net.sf.cglib.proxy

Examples of net.sf.cglib.proxy.Factory


        }
    }
   
    @SuppressWarnings("unchecked")
    private static <T> MethodInterceptorFilter<MockHandler<T>> getInterceptor(T mock) {
        Factory factory = (Factory) mock;
        return (MethodInterceptorFilter) factory.getCallback(0);
    }
View Full Code Here


        _specifiedAttrs.add(attr);
    }
   
    private void done() {
        if (_entity != null) {
            Factory factory = (Factory)_entity;
            factory.setCallback(0, null);
            _entity = null;
        }
               
        if (_selects == null || _selects.size() == 0) {
            _selectType = SelectType.Entity;
View Full Code Here

    @Override
    @SuppressWarnings("unchecked") @DB(txn=false)
    public <J> GenericSearchBuilder<T, J> createSearchBuilder(Class<J> resultType) {
        final T entity = (T)_searchEnhancer.create();
        final Factory factory = (Factory)entity;
        GenericSearchBuilder<T, J> builder = new GenericSearchBuilder<T, J>(entity, resultType, _allAttributes);
        factory.setCallback(0, builder);
        return builder;
    }
View Full Code Here

        return true;
    }

    @DB(txn=false)
    public static <T> UpdateBuilder getUpdateBuilder(final T entityObject) {
        final Factory factory = (Factory)entityObject;
        assert(factory != null);
        return (UpdateBuilder)factory.getCallback(1);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override @DB(txn=false)
    public SearchBuilder<T> createSearchBuilder() {
        final T entity = (T)_searchEnhancer.create();
        final Factory factory = (Factory)entity;
        SearchBuilder<T> builder = new SearchBuilder<T>(entity, _allAttributes);
        factory.setCallback(0, builder);
        return builder;
    }
View Full Code Here

    }

    @Override @DB(txn=false)
    public <K> SearchCriteria2 createSearchCriteria2(Class<K> resultType) {
        final T entity = (T)_searchEnhancer.create();
        final Factory factory = (Factory)entity;
        SearchCriteria2 sc = new SearchCriteria2(entity, resultType, _allAttributes, this);
        factory.setCallback(0, sc);
        return sc;
    }
View Full Code Here

    }

    @Override @DB(txn=false)
    public SearchCriteria2 createSearchCriteria2() {
        final T entity = (T)_searchEnhancer.create();
        final Factory factory = (Factory)entity;
        SearchCriteria2 sc = new SearchCriteria2(entity, entity.getClass(), _allAttributes, this);
        factory.setCallback(0, sc);
        return sc;
    }
View Full Code Here

    /**
     * Marks the SearchBuilder as completed in building the search conditions.
     */
    public synchronized void done() {
        if (_entity != null) {
            Factory factory = (Factory)_entity;
            factory.setCallback(0, null);
            _entity = null;
        }
       
        if (_joins != null) {
          for (JoinBuilder<GenericSearchBuilder<?, ?>> join : _joins.values()) {
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
        if (isProxyClass(target.getClass())) {
            Factory factory = (Factory)target;
            Callback[] callbacks = factory.getCallbacks();
            if (callbacks.length != 1 || !(callbacks[0] instanceof CglibMethodInterceptor)) {
                throw new IllegalArgumentException("The object is not a known proxy.");
            }
            CglibMethodInterceptor interceptor = (CglibMethodInterceptor)callbacks[0];
            return (R)interceptor.invocationHandler.getCallableReference();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
        if (isProxyClass(target.getClass())) {
            Factory factory = (Factory)target;
            Callback[] callbacks = factory.getCallbacks();
            if (callbacks.length != 1 || !(callbacks[0] instanceof CglibMethodInterceptor)) {
                throw new IllegalArgumentException("The object is not a known proxy.");
            }
            CglibMethodInterceptor interceptor = (CglibMethodInterceptor)callbacks[0];
            return (R)interceptor.invocationHandler.getCallableReference();
View Full Code Here

TOP

Related Classes of net.sf.cglib.proxy.Factory

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.