Examples of Binder


Examples of org.hibernate.metamodel.source.binder.Binder

  public void processMappingMetadata(MetadataSources sources, List<String> processedEntityNames) {
    assertBindingContextExists();
    // need to order our annotated entities into an order we can process
    Set<EntityHierarchy> hierarchies = EntityHierarchyBuilder.createEntityHierarchies( bindingContext );

    Binder binder = new Binder( bindingContext.getMetadataImplementor(), new ArrayList<String>() );
    for ( EntityHierarchy hierarchy : hierarchies ) {
      binder.processEntityHierarchy( hierarchy );
    }
  }
View Full Code Here

Examples of org.hibernate.metamodel.source.binder.Binder

    }
  }

  @Override
  public void processMappingMetadata(MetadataSources sources, List<String> processedEntityNames) {
    Binder binder = new Binder( metadata, processedEntityNames );
    for ( EntityHierarchyImpl entityHierarchy : entityHierarchies ) {
      binder.processEntityHierarchy( entityHierarchy );
    }
  }
View Full Code Here

Examples of org.jclouds.rest.Binder

            parametersWithAnnotation(invocation.getInvokable(), BinderParam.class),
            parametersWithAnnotation(invocation.getInvokable(), WrapWith.class)));
      OUTER: for (Parameter entry : binderOrWrapWith) {
         int position = entry.hashCode();
         boolean shouldBreak = false;
         Binder binder;
         if (entry.isAnnotationPresent(BinderParam.class))
            binder = injector.getInstance(entry.getAnnotation(BinderParam.class).value());
         else
            binder = injector.getInstance(BindToJsonPayloadWrappedWith.Factory.class).create(
                  entry.getAnnotation(WrapWith.class).value());
         Object arg = args.size() >= position + 1 ? args.get(position) : null;
         if (args.size() >= position + 1 && arg != null) {
            Class<?> parameterType = entry.getType().getRawType();
            Class<? extends Object> argType = arg.getClass();
            if (!argType.isArray() && parameterType.isArray()) {// TODO: &&
                                                                // invocation.getInvokable().isVarArgs())
                                                                // {
               int arrayLength = args.size() - invocation.getInvokable().getParameters().size() + 1;
               if (arrayLength == 0)
                  break OUTER;
               arg = (Object[]) Array.newInstance(arg.getClass(), arrayLength);
               System.arraycopy(args.toArray(), position, arg, 0, arrayLength);
               shouldBreak = true;
            } else if (argType.isArray() && parameterType.isArray()) {// TODO:
                                                                      // &&
                                                                      // invocation.getInvokable().isVarArgs())
                                                                      // {
            } else {
               if (arg.getClass().isArray()) {
                  Object[] payloadArray = (Object[]) arg;
                  arg = payloadArray.length > 0 ? payloadArray[0] : null;
               }
            }
            if (arg != null) {
               request = binder.bindToRequest(request, arg);
            }
            if (shouldBreak)
               break OUTER;
         } else {
            if (position + 1 == invocation.getInvokable().getParameters().size() && entry.getType().isArray())// TODO:
View Full Code Here

Examples of org.jclouds.rest.Binder

            parametersWithAnnotation(invocation.getInvokable(), BinderParam.class),
            parametersWithAnnotation(invocation.getInvokable(), WrapWith.class)));
      OUTER: for (Parameter entry : binderOrWrapWith) {
         int position = entry.hashCode();
         boolean shouldBreak = false;
         Binder binder;
         if (entry.isAnnotationPresent(BinderParam.class))
            binder = injector.getInstance(entry.getAnnotation(BinderParam.class).value());
         else
            binder = injector.getInstance(BindToJsonPayloadWrappedWith.Factory.class).create(
                  entry.getAnnotation(WrapWith.class).value());
         Object arg = args.size() >= position + 1 ? args.get(position) : null;
         if (args.size() >= position + 1 && arg != null) {
            Class<?> parameterType = entry.getType().getRawType();
            Class<? extends Object> argType = arg.getClass();
            if (!argType.isArray() && parameterType.isArray()) {// TODO: &&
                                                                // invocation.getInvokable().isVarArgs())
                                                                // {
               int arrayLength = args.size() - invocation.getInvokable().getParameters().size() + 1;
               if (arrayLength == 0)
                  break OUTER;
               arg = (Object[]) Array.newInstance(arg.getClass(), arrayLength);
               System.arraycopy(args.toArray(), position, arg, 0, arrayLength);
               shouldBreak = true;
            } else if (argType.isArray() && parameterType.isArray()) {// TODO:
                                                                      // &&
                                                                      // invocation.getInvokable().isVarArgs())
                                                                      // {
            } else {
               if (arg.getClass().isArray()) {
                  Object[] payloadArray = (Object[]) arg;
                  arg = payloadArray.length > 0 ? payloadArray[0] : null;
               }
            }
            if (arg != null) {
               request = binder.bindToRequest(request, arg);
            }
            if (shouldBreak)
               break OUTER;
         } else {
            if (position + 1 == invocation.getInvokable().getParameters().size() && entry.getType().isArray())// TODO:
View Full Code Here

Examples of org.qi4j.runtime.model.Binder

                        InjectedFieldModel fieldModel = (InjectedFieldModel) visited;
                        fieldModel.bind( resolution.forField( fieldModel.field() ) );
                        return false;
                    } else if( visited instanceof Binder )
                    {
                        Binder constructorsModel = (Binder) visited;
                        constructorsModel.bind( resolution );

                        return false;
                    }
                    return true;
                }
View Full Code Here

Examples of org.qi4j.runtime.model.Binder

        @Override
        public boolean visitEnter( Object visited ) throws BindingException
        {
            if (visited instanceof Binder )
            {
                Binder binder = (Binder) visited;
                binder.bind( resolution );

                return false;
            }
            else if (visited instanceof CompositeMethodModel )
            {
View Full Code Here

Examples of org.springframework.richclient.form.binding.Binder

     * @param id Id of the binder
     * @return Binder or <code>null</code> if not found.
     */
    public Binder getIdBoundBinder(String id)
    {
        Binder binder = idBoundBinders.get(id);
        if (binder == null) //  try to locate the binder bean
        {
            Object binderBean = getApplicationContext().getBean(id);
            if (binderBean instanceof Binder)
            {
View Full Code Here

Examples of org.springframework.richclient.form.binding.Binder

        registerDefaultBinders();
    }

    public Binder selectBinder(FormModel formModel, String propertyName) {
        // first try and find a binder for the specific property name
        Binder binder = findBinderByPropertyName(formModel.getFormObject().getClass(), propertyName);
        if (binder == null) {
            // next try and find a binder for the specific property type
            binder = findBinderByPropertyType(getPropertyType(formModel, propertyName));
        }
        if (binder == null) {
View Full Code Here

Examples of org.springframework.richclient.form.binding.Binder

        throw new UnsupportedOperationException("Unable to select a binder for form model [" + formModel
                + "] property [" + propertyName + "]");
    }

    public Binder selectBinder(Class controlType, FormModel formModel, String propertyName) {
        Binder binder = findBinderByControlType(controlType);
        if (binder == null) {
            binder = selectBinder(formModel, propertyName);
        }
        if (binder != null) {
            return binder;
View Full Code Here

Examples of org.springframework.richclient.form.binding.Binder

     * direct match found try to find binder for any superclass of the provided
     * objectType which also has the same propertyName.
     */
    protected Binder findBinderByPropertyName(Class parentObjectType, String propertyName) {
        PropertyNameKey key = new PropertyNameKey(parentObjectType, propertyName);
        Binder binder = (Binder)propertyNameBinders.get(key);
        if (binder == null) {
            // if no direct match was found try to find a match in any super classes
            final Map potentialMatchingBinders = new HashMap();
            for (Iterator i = propertyNameBinders.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry)i.next();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.