Examples of ParameterDescriptor


Examples of javax.validation.metadata.ParameterDescriptor

    assertTrue( returnValueDescriptor.isCascaded(), "<valid/> is used to configure cascading" );

    List<ParameterDescriptor> parameterDescriptors = descriptor.getParameterDescriptors();
    assertTrue( parameterDescriptors.size() == 1 );

    ParameterDescriptor parameterDescriptor = parameterDescriptors.get( 0 );
    assertTrue( parameterDescriptor.isCascaded(), "<valid/> is used to configure cascading" );
  }
View Full Code Here

Examples of javax.validation.metadata.ParameterDescriptor

    assertEquals( groupConversionDescriptor.getFrom(), Default.class, "Wrong from class for group conversion" );

    List<ParameterDescriptor> parameterDescriptors = descriptor.getParameterDescriptors();
    assertTrue( parameterDescriptors.size() == 1 );

    ParameterDescriptor parameterDescriptor = parameterDescriptors.get( 0 );
    groupConversionDescriptors = parameterDescriptor.getGroupConversions();
    assertTrue( groupConversionDescriptors.size() == 1 );

    groupConversionDescriptor = groupConversionDescriptors.iterator().next();
    assertEquals( groupConversionDescriptor.getFrom(), Default.class, "Wrong from class for group conversion" );
  }
View Full Code Here

Examples of javax.validation.metadata.ParameterDescriptor

    assertFalse( crossParameterDescriptor.hasConstraints(), "Cross parameter constraints should be ignored." );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.hasConstraints(), "Return value constraints should be ignored." );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.hasConstraints(), "First parameter constraints should be ignored." );

    parameterDescriptor = descriptor.getParameterDescriptors().get( 1 );
    assertTrue( parameterDescriptor.hasConstraints(), "Second parameter constraints should be applied." );
  }
View Full Code Here

Examples of javax.validation.metadata.ParameterDescriptor

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.hasConstraints(), "Return value constraints should be ignored." );
    assertTrue( returnValueDescriptor.getGroupConversions().isEmpty(), "Group conversions should be ignored" );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.hasConstraints(), "First parameter constraints should be ignored." );
    assertTrue( parameterDescriptor.getGroupConversions().isEmpty(), "Group conversions should be ignored" );

    parameterDescriptor = descriptor.getParameterDescriptors().get( 1 );
    assertTrue( parameterDescriptor.hasConstraints(), "Second parameter constraints should be applied." );
    assertEquals( parameterDescriptor.getGroupConversions().size(), 2, "All group conversions should be combined" );
  }
View Full Code Here

Examples of modTransf.engine.ParameterDescriptor

     Iterator paramIter = parameters.iterator();
     // Rule domains are used to check the direction
     Iterator descIter = rule.getParameterDescriptors().iterator();
     while(paramIter.hasNext())
     {
       ParameterDescriptor paramDesc = (ParameterDescriptor)descIter.next();
       ParameterExpression exprValue = (ParameterExpression)paramIter.next();
       //System.out.println( ruleName + ".desc."+paramDesc.isIn(context)+ " ");
       if( paramDesc.isIn(context) )
       {
         Object arg = exprValue.getValue(context);
         args.add(arg);
       }
       else
View Full Code Here

Examples of modTransf.engine.ParameterDescriptor

      // Iterate on argument values
    Iterator argsIter = args.iterator();

    while(paramIter.hasNext())
    {
      ParameterDescriptor paramDesc = (ParameterDescriptor)descIter.next();
      ParameterExpression exprValue = (ParameterExpression)paramIter.next();
      Object value = argsIter.next();
      //System.out.println("store result (isOut=" +paramDesc.isOut(context) + ") '" + value + "'" );
      if( paramDesc.isOut(context) )
      {
        if( value != null )
          exprValue.setValue( value, context);
      }
    }
View Full Code Here

Examples of modTransf.engine.ParameterDescriptor

    Iterator iterRegistered = registeredRule.getParameterDescriptors().iterator();
    Iterator iterClone = rule.getParameterDescriptors().iterator();
    int i=0;
    while( iterClone.hasNext() )
    {
      ParameterDescriptor descRegistered = (ParameterDescriptor)iterRegistered.next();
      ParameterDescriptor descClone= (ParameterDescriptor)iterClone.next();
      assertEquals("desc["+i+"].isIn", descRegistered.isIn(context), descClone.isIn(context) );
      assertEquals("desc["+i+"].isOut", descRegistered.isOut(context), descClone.isOut(context) );
      i++;
    }

  }
View Full Code Here

Examples of org.apache.slide.projector.descriptor.ParameterDescriptor

    public void configure(StreamableValue config) throws ConfigurationException {
        super.configure(config);
        parameterDescriptors = new ParameterDescriptor[parameterDescriptions.size()];
        int counter = 0;
        for ( Iterator i = parameterDescriptions.iterator(); i.hasNext(); ) {
            ParameterDescriptor entryDescriptor = (ParameterDescriptor)i.next();
            if ( entryDescriptor.getName() == FRAGMENT ) {
                parameterDescriptors[counter] = entryDescriptor;
            } else {
                parameterDescriptors[counter] = new ParameterDescriptor(entryDescriptor.getName(), new ParameterMessage("templateArrayRenderer/parameter"), new ArrayValueDescriptor(entryDescriptor.getValueDescriptor()));
            }
            counter++;
        }
    }
View Full Code Here

Examples of org.apache.slide.projector.descriptor.ParameterDescriptor

    public void configure(StreamableValue config) throws ConfigurationException {
        super.configure(config);
        MapValueDescriptor mapValueDescriptor = new MapValueDescriptor();
        List parameterDescriptorList = new ArrayList();
        for ( Iterator i = parameterDescriptions.iterator(); i.hasNext(); ) {
            ParameterDescriptor entryDescriptor = (ParameterDescriptor)i.next();
            // add all map parameters to optional parameters
            if ( entryDescriptor.getName() == FRAGMENT ) {
                parameterDescriptorList.add(entryDescriptor);
            } else {
                if ( entryDescriptor.isRequired() ) {
                    mapValueDescriptor.addEntryDescriptor(new ParameterDescriptor(entryDescriptor.getName(), new ParameterMessage("templateMapRenderer/mapEntry"), entryDescriptor.getValueDescriptor()));
                } else {
                    mapValueDescriptor.addEntryDescriptor(new ParameterDescriptor(entryDescriptor.getName(), new ParameterMessage("templateMapRenderer/mapEntry"), entryDescriptor.getValueDescriptor(), entryDescriptor.getDefaultValue() ));
                    parameterDescriptorList.add(new ParameterDescriptor(entryDescriptor.getName(), entryDescriptor.getDescription(), entryDescriptor.getValueDescriptor(), NullValue.NULL));
                }
            }
        }
        parameterDescriptorList.add(new ParameterDescriptor(SimpleProcessor.INPUT, new ParameterMessage("templateMapRenderer/input"), mapValueDescriptor));
        parameterDescriptors = (ParameterDescriptor[])parameterDescriptorList.toArray(new ParameterDescriptor[parameterDescriptorList.size()]);
    }
View Full Code Here

Examples of org.apache.slide.projector.descriptor.ParameterDescriptor

                    if ( !requiredFragmentDefined ) {
                        throw new ConfigurationException(new ErrorMessage("templateRenderer/requiredFragmentMissing", new String[] { requiredFragments[i] }));
                    }
                }
            }
            parameterDescriptions.add(new ParameterDescriptor(FRAGMENT, new ParameterMessage("templateRenderer/fragment"), new StringValueDescriptor((String [])templates.keySet().toArray(new String[0])), new StringValue(DEFAULT_FRAGMENT)));
            if ( fragments ) {
                if ( requiredFragments != null ) {
                    templates.put(DEFAULT_FRAGMENT, templates.get(requiredFragments[0]));
                } else if ( optionalFragments != null ) {
                    templates.put(DEFAULT_FRAGMENT, templates.get(optionalFragments[0]));
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.