Package org.apache.commons.collections

Examples of org.apache.commons.collections.SequencedHashMap$OrderedIterator


  }

  protected void setStyles(JRReport report)
  {
    //styleFactory = new StyleFactory();
    stylesMap = new SequencedHashMap();
   
    loadReportStyles(report);
   
    try
    {
View Full Code Here


    cellsMap = new HashMap();
    cellsList = new ArrayList();
   
    addBuiltinParameters();
   
    variablesList = new SequencedHashMap();
    addBuiltinVariables();
   
    dataset = new JRDesignCrosstabDataset();
  }
View Full Code Here

      }
    }
   
    if (variablesList != null)
    {
      clone.variablesList = new SequencedHashMap(variablesList.size());
      for(Iterator it = variablesList.values().iterator(); it.hasNext();)
      {
        JRVariable variable = (JRVariable) it.next();
        // check whether the variable was already cloned as part of a group or measure
        JRVariable variableClone = (JRVariable) clonedVariables.get(variable);
View Full Code Here

   
    //filtering requested styles
    Set requestedStyles = collectRequestedStyles(styles);
   
    //collect used styles
    Map usedStylesMap = new SequencedHashMap();
    Map allStylesMap = new HashMap();
    for (Iterator it = styles.iterator(); it.hasNext();)
    {
      JRStyle style = (JRStyle) it.next();
      if (requestedStyles.contains(style))
      {
        collectUsedStyles(style, usedStylesMap, allStylesMap);
      }
      allStylesMap.put(style.getName(), style);
    }
   
    List includedStyles = new ArrayList();
    for (Iterator it = usedStylesMap.keySet().iterator(); it.hasNext();)
    {
      JRStyle style = (JRStyle) it.next();
      JRStyle newStyle = getStyle(style);
     
      includedStyles.add(newStyle);
View Full Code Here

    if ( "refresh".equals( cacheMode ) ) return CacheMode.REFRESH;
    throw new MappingException("Unknown Cache Mode: " + cacheMode);
  }

  public static java.util.Map getParameterTypes(Element queryElem) {
    java.util.Map result = new SequencedHashMap();
    Iterator iter = queryElem.elementIterator("query-param");
    while ( iter.hasNext() ) {
      Element element = (Element) iter.next();
      result.put(
          element.attributeValue("name"),
          element.attributeValue("type")
        );
    }
    return result;
View Full Code Here

  /**
   * Return a new instance of this class, with iteration
   * order defined by the order that entries were added
   */
  public static Map instantiateSequenced(int size) {
    return new IdentityMap( new SequencedHashMap(size) );
  }
View Full Code Here

        return getFields(clazz, "");
    }

    protected Map getFields(XClass clazz, String prefix) throws XDocletException
    {
        Map fields = new SequencedHashMap();

        Collection curFields = clazz.getMethods(true);

        // TODO: nested forms currently won't work unless
        // there is a setter for it, but that is not needed
        // as only the sub-forms must have setters.  The top-level
        // only requires a getter.
        for (Iterator iterator = curFields.iterator(); iterator.hasNext(); ) {
            XMethod method = (XMethod) iterator.next();
            XTag tag = method.getDoc().getTag("struts.validator");
            String override = null;

            if (tag != null) {
                override = tag.getAttributeValue("override");
            }

            if (tag != null) {
                List params = method.getParameters();
                String name = method.getPropertyName();
                XParameter param = null;

                if (MethodTagsHandler.isSetterMethod(method)) {
                    param = (XParameter) params.get(0);
                }
                else if (params.size() == 2) {
                    // Check for indexed setter setBlah(int index, <type> value)
                    if (!MethodTagsHandler.isSetter(method.getName()))
                        continue;

                    Iterator paramIter = params.iterator();

                    if (!((XParameter) paramIter.next()).getType().isA("int"))
                        continue;

                    if (name.indexOf("[]") >= 0) {
                        throw new XDocletException(Translator.getString(StrutsValidatorMessages.class,
                            StrutsValidatorMessages.ONLY_ONE_LEVEL_LIST_PROPS,
                            new String[]{clazz.getName() + '.' + name + "[]"}));
                    }

                    name = name + "[]";
                    param = (XParameter) paramIter.next();
                }
                else
                    continue;

                String type = param.getType().getQualifiedName();

                if (supportedTypes.contains(type)) {
                    fields.put(prefix + name, method);
                }
                else if ((override != null) && (override.equals("true"))) {
                    fields.put(prefix + name, method);
                }
                else {

                    boolean preDot = (prefix.length() > 0 && prefix.charAt(prefix.length() - 1) != '.');

                    fields.putAll(getFields(param.getType(), prefix + (preDot ? "." : "") + name + "."));
                }
            }
        }

        return fields;
View Full Code Here

         * the argN[resource|value] piece is the actual parameter name.
         * N is the argument index.
         * TYPE is added only if the parameter appears on struts.validator tag
         * which indicates it's only associated with a specific validator type.
         */
        args = new SequencedHashMap();

        XMethod method = getCurrentMethod();

        // Collect all general args
        Collection argTags = method.getDoc().getTags("struts.validator-args");
View Full Code Here

        return getFields(clazz, "");
    }

    private Map getFields(XClass clazz, String prefix) throws XDocletException
    {
        Map fields = new SequencedHashMap();

        Collection curFields = clazz.getMethods(true);

        // TODO: nested forms currently won't work unless
        // there is a setter for it, but that is not needed
        // as only the sub-forms must have setters.  The top-level
        // only requires a getter.
        for (Iterator iterator = curFields.iterator(); iterator.hasNext(); ) {
            XMethod setter = (XMethod) iterator.next();

            if (MethodTagsHandler.isSetterMethod(setter)) {
                if (setter.getDoc().getTag("spring.validator") != null) {
                    String name = MethodTagsHandler.getPropertyNameFor(setter);
                    XParameter param = (XParameter) setter.getParameters().iterator().next();
                    String type = param.getType().getQualifiedName();

                    if (supportedTypes.contains(type)) {
                        fields.put(prefix + name, setter);
                    }
                    else {
                        fields.putAll(getFields(param.getType(), prefix + (prefix.length() == 0 ? "" : ".") + name + "."));
                    }
                }
            }
        }
View Full Code Here

         * the argN[resource|value] piece is the actual parameter name.
         * N is the argument index.
         * TYPE is added only if the parameter appears on spring.validator tag
         * which indicates its only associated with a specific validator type.
         */
        args = new SequencedHashMap();

        XMethod method = getCurrentMethod();

        // Collect all general args
        Collection argTags = method.getDoc().getTags("spring.validator-args");
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.SequencedHashMap$OrderedIterator

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.