Package org.apache.wink.common.internal.registry.metadata

Examples of org.apache.wink.common.internal.registry.metadata.ConstructorMetadata


     * @return created object
     */
    static Object createObject(ClassMetadata metadata, RuntimeContext runtimeContext) {
        try {
            // use constructor to create a prototype
            ConstructorMetadata constructorMetadata = metadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            Object[] params =
                InjectableFactory.getInstance().instantiate(formalParameters, runtimeContext);
            Object object = constructor.newInstance(params);
            injectFields(object, metadata, runtimeContext);
            return object;
View Full Code Here


     * @return created object
     */
    static Object createObject(ClassMetadata metadata, RuntimeContext runtimeContext) {
        try {
            // use constructor to create a prototype
            ConstructorMetadata constructorMetadata = metadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            Object[] params =
                InjectableFactory.getInstance().instantiate(formalParameters, runtimeContext);
            Object object = constructor.newInstance(params);
            return object;
        } catch (RuntimeException e) {
View Full Code Here

        private final Class<T>      clazz;
        private T                   instance;

        public GuiceSingletonObjectFactory(Class<T> clazz, Injector injector) {
            classMetadata = collectClassMetadata(clazz);
            ConstructorMetadata constructorMetadata = classMetadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            isConstructorNoArgumentOrInject =
                formalParameters.size() == 0 || constructor.getAnnotation(Inject.class) != null;
            this.injector = injector;
            this.clazz = clazz;
        }
View Full Code Here

        private final Injector      injector;
        private final Class<T>      clazz;

        public GuicePrototypeObjectFactory(Class<T> clazz, Injector injector) {
            classMetadata = collectClassMetadata(clazz);
            ConstructorMetadata constructorMetadata = classMetadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            isConstructorNoArgumentOrInject =
                formalParameters.size() == 0 || constructor.getAnnotation(Inject.class) != null;
            this.injector = injector;
            this.clazz = clazz;
        }
View Full Code Here

     * @return created object
     */
    static Object createObject(ClassMetadata metadata, RuntimeContext runtimeContext) {
        try {
            // use constructor to create a prototype
            ConstructorMetadata constructorMetadata = metadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            Object[] params =
                InjectableFactory.getInstance().instantiate(formalParameters, runtimeContext);
            Object object = constructor.newInstance(params);
            return object;
        } catch (RuntimeException e) {
View Full Code Here

        private final Class<T>      clazz;
        private T                   instance;

        public GuiceSingletonObjectFactory(Class<T> clazz, Injector injector) {
            classMetadata = collectClassMetadata(clazz);
            ConstructorMetadata constructorMetadata = classMetadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            isConstructorNoArgumentOrInject =
                formalParameters.size() == 0 || constructor.getAnnotation(Inject.class) != null;
            this.injector = injector;
            this.clazz = clazz;
        }
View Full Code Here

        private final Injector      injector;
        private final Class<T>      clazz;

        public GuicePrototypeObjectFactory(Class<T> clazz, Injector injector) {
            classMetadata = collectClassMetadata(clazz);
            ConstructorMetadata constructorMetadata = classMetadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            isConstructorNoArgumentOrInject =
                formalParameters.size() == 0 || constructor.getAnnotation(Inject.class) != null;
            this.injector = injector;
            this.clazz = clazz;
        }
View Full Code Here

     * @return created object
     */
    static Object createObject(ClassMetadata metadata, RuntimeContext runtimeContext) {
        try {
            // use constructor to create a prototype
            ConstructorMetadata constructorMetadata = metadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            Object[] params =
                InjectableFactory.getInstance().instantiate(formalParameters, runtimeContext);
            Object object = constructor.newInstance(params);
            return object;
        } catch (RuntimeException e) {
View Full Code Here

        private final Class<T>      clazz;
        private T                   instance;

        public GuiceSingletonObjectFactory(Class<T> clazz, Injector injector) {
            classMetadata = collectClassMetadata(clazz);
            ConstructorMetadata constructorMetadata = classMetadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            isConstructorNoArgumentOrInject =
                formalParameters.size() == 0 || constructor.getAnnotation(Inject.class) != null;
            this.injector = injector;
            this.clazz = clazz;
        }
View Full Code Here

        private final Injector      injector;
        private final Class<T>      clazz;

        public GuicePrototypeObjectFactory(Class<T> clazz, Injector injector) {
            classMetadata = collectClassMetadata(clazz);
            ConstructorMetadata constructorMetadata = classMetadata.getConstructor();
            Constructor<?> constructor = constructorMetadata.getConstructor();
            List<Injectable> formalParameters = constructorMetadata.getFormalParameters();
            isConstructorNoArgumentOrInject =
                formalParameters.size() == 0 || constructor.getAnnotation(Inject.class) != null;
            this.injector = injector;
            this.clazz = clazz;
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.registry.metadata.ConstructorMetadata

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.