Populate either the object o via setters or the Collection col by adding
elements of type cl

@param o
@param subroot
@param col
@param cl
@throws ConfigException
427165
private void populate(final Element subroot,
                        final Object o,
                        final Collection<Object> col,
                        final Class cl) throws Throwable {
    String name = subroot.getNodeName();

    Method meth = null;

    Class elClass = null;

    if (col == null) {
      /* We must have a setter */
      meth = findSetter(o, name);

      if (meth == null) {
        error("No setter for " + name);

        return;
      }

      /* We require a single parameter */

      Class[] parClasses = meth.getParameterTypes();
      if (parClasses.length != 1) {
        error("Invalid setter method " + name);
        throw new ConfigException("Invalid setter method " + name);
      }

      elClass = parClasses[0];
    } else {
      elClass = cl;
    }

    if (!XmlUtil.hasChildren(subroot)) {
      /* A primitive value for which we should have a setter */

      Object val = simpleValue(elClass, subroot, name);
      if (val != null) {
        assign(val, col, o, meth);
      }

      return;
    }

    /* There are children to this element. It either represents a complex type
     * or a collection.
     */

    if (Collection.class.isAssignableFrom(elClass)) {
      Collection<Object> colVal = null;

      if (elClass.getName().equals("java.util.Set")) {
        colVal = new TreeSet<Object>();
      } else if (elClass.getName().equals("java.util.List")) {
        colVal = new ArrayList<Object>();
      } else {
        error("Unsupported element class " + elClass +
              " for field " + name);
        return;
      }

      assign(colVal, col, o, meth);

      // Figure out the class of the elements
      /* I thought I might be able toextract it from the generic info -
       * Doesn't appear to be the case.
       *
      Type gft = elClass;

      if (!(gft instanceof ParameterizedType)) {
        error("Unsupported type " + elClass +
              " with name " + name);
        return;
      }

      Type[] fieldArgTypes = ((ParameterizedType)gft).getActualTypeArguments();

      if (fieldArgTypes.length != 1) {
        error("Unsupported type " + elClass +
              " with name " + name);
        return;
      }

      Class colElType = (Class)fieldArgTypes[0];
      */
      ConfInfo ci = meth.getAnnotation(ConfInfo.class);

      String colElTypeName;

      if (ci == null) {
        colElTypeName = "java.lang.String";
      } else {
        colElTypeName = ci.elementType();
      }

      for (Element el: XmlUtil.getElementsArray(subroot)) {
        populate(el, o, colVal, Class.forName(colElTypeName));
      }

      return;
    }

    /* Asssume a complex type */

    Object val = getObject(subroot, elClass);

    assign(val, col, o, meth);

    for (Element el: XmlUtil.getElementsArray(subroot)) {
      populate(el, val, null, null);
    }
  }
148958
final
  public void configureImpl(Object bean) // , ConfigType<?> type)
    throws ConfigException
  {
    Objects.requireNonNull(bean);
    //Objects.requireNonNull(type);
    
    try {
      //type.beforeConfigure(bean);
      
      // ioc/23e7
      InjectContext env = InjectContextImpl.CONTEXT;
      injectTop(bean, env);
    
      //type.init(bean);
    } finally {
      //type.afterConfigure(bean);
    }
  }
1335038
public void set(final int row, final int col, final Object o) {
    if (o == null)
      cellValues[row][col] = new IcedWrapper(null);
    else if (o instanceof Double && Double.isNaN((double)o))
      cellValues[row][col] = new IcedWrapper(Double.NaN);
    else if (o instanceof int[])
      cellValues[row][col] = new IcedWrapper(Arrays.toString((int[])o));
    else if (o instanceof long[])
      cellValues[row][col] = new IcedWrapper(Arrays.toString((long[])o));
    else if (o instanceof float[])
      cellValues[row][col] = new IcedWrapper(Arrays.toString((float[])o));
    else if (o instanceof double[])
      cellValues[row][col] = new IcedWrapper(Arrays.toString((double[])o));
    else if (colTypes[col]=="string")
      cellValues[row][col] = new IcedWrapper(o.toString());
    else
      cellValues[row][col] = new IcedWrapper(o);
  }

  /**
   * Print table to String, using 2 spaces for padding between columns
   * @return String containing the ASCII version of the table
   */
  public String toString() {
    return toString(2, true);
  }
  /**
   * Print table to String, using user-given padding
   * @param pad number of spaces for padding between columns
   * @return String containing the ASCII version of the table
   */
  public String toString(final int pad) {
    return toString(pad, true);
  }

  private static int PRINTOUT_ROW_LIMIT = 20;
  private boolean skip(int row) {
    assert(PRINTOUT_ROW_LIMIT % 2 == 0);
    if (getRowDim() <= PRINTOUT_ROW_LIMIT) return false;
    if (row <= PRINTOUT_ROW_LIMIT/2) return false;
    if (row >= getRowDim()-PRINTOUT_ROW_LIMIT/2) return false;
    return true;
  }
  /**
   * Print table to String, using user-given padding
   * @param pad number of spaces for padding between columns
   * @param full whether to print the full table (otherwise top 5 and bottom 5 rows only)
   * @return String containing the ASCII version of the table
   */
  public String toString(final int pad, boolean full) {
    if (pad < 0)
      throw new IllegalArgumentException("pad must be a non-negative integer");

    final int rowDim = getRowDim();
    final int colDim = getColDim();

    final int actualRowDim = full ? rowDim : Math.min(PRINTOUT_ROW_LIMIT+1, rowDim);

    final String[][] cellStrings = new String[actualRowDim + 1][colDim + 1];
    for (String[] row: cellStrings)
      Arrays.fill(row, "");

    cellStrings[0][0] = colHeaderForRowHeaders != null ? colHeaderForRowHeaders : "";
    int row = 0;
    for (int r = 0; r < rowDim; ++r) {
      if (!full && skip(r)) continue;
      cellStrings[row+1][0] = rowHeaders[r];
      row++;
    }
    for (int c = 0; c < colDim; ++c)
      cellStrings[0][c+1] = colHeaders[c];

    for (int c = 0; c < colDim; ++c) {
      final String formatString = colFormats[c];
      row = 0;
      for (int r = 0; r < rowDim; ++r) {
        if (!full && skip(r)) continue;
        Object o = get(r,c);
        if ((o == null) || o instanceof Double && isEmpty((double)o)){
          cellStrings[row + 1][c + 1] = "";
          row++;
          continue;
        } else if (o instanceof Double && Double.isNaN((double)o)) {
          cellStrings[row + 1][c + 1] = "NaN";
          row++;
          continue;
        }
        try {
          if (o instanceof Double) cellStrings[row + 1][c + 1] = String.format(formatString, (Double) o);
          else if (o instanceof Float) cellStrings[row + 1][c + 1] = String.format(formatString, (Float) o);
          else if (o instanceof Integer) cellStrings[row + 1][c + 1] = String.format(formatString, (Integer) o);
          else if (o instanceof Long) cellStrings[row + 1][c + 1] = String.format(formatString, (Long) o);
          else if (o instanceof String) cellStrings[row + 1][c + 1] = (String)o;
          else cellStrings[row + 1][c + 1] = String.format(formatString, cellValues[r][c]);
        } catch(Throwable t) {
          cellStrings[row + 1][c + 1] = o.toString();
        }
        row++;
      }
    }

    final int[] colLen = new int[colDim + 1];
    for (int c = 0; c <= colDim; ++c) {
      for (int r = 0; r <= actualRowDim; ++r) {
        colLen[c] = Math.max(colLen[c], cellStrings[r][c].length());
      }
    }

    final StringBuilder sb = new StringBuilder();
    if (tableHeader.length() > 0) {
      sb.append(tableHeader);
    }
    if (tableDescription.length() > 0) {
      sb.append(" (").append(tableDescription).append(")");
    }
    sb.append(":\n");
    for (int r = 0; r <= actualRowDim; ++r) {
      int len = colLen[0];
      if (actualRowDim != rowDim && r - 1 == PRINTOUT_ROW_LIMIT/2) {
        assert(!full);
        sb.append("---");
      } else {
        if (len > 0)
          sb.append(String.format("%" + colLen[0] + "s", cellStrings[r][0]));
        for (int c = 1; c <= colDim; ++c) {
          len = colLen[c];
          if (len > 0)
            sb.append(String.format("%" + (len + pad) + "s", cellStrings[r][c].equals("null") ? "" : cellStrings[r][c]));
        }
      }
      sb.append("\n");
    }

   return sb.toString();
  }
300076
@Override
    public void setSubProtocols(String... protocols) {
        subProtocols.clear();
        Collections.addAll(subProtocols, protocols);
    }
935111
@Override
    public void readFromObject(Object object) {
        try {
            Method method = BeanUtils.getReadMethod(object.getClass(), getName());
            if (method != null) {
                Object value = method.invoke(object);
                initializeValue(value); // avoid updating parent or firing property change
                if (value != null) {
                    for (Property subProperty : subProperties) {
                        subProperty.readFromObject(value);
                    }
                }
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
663147
public final void setObjectTypeNode(final ObjectTypeNode objectTypeNode) {
        this.objectTypeNode = objectTypeNode;

        NodeReferenceSetter setter= new NodeReferenceSetter();
        ObjectTypeNodeParser parser = new ObjectTypeNodeParser(objectTypeNode);
        parser.accept(setter);
    }
530951
private void setChildObjects(Object pParent, ObjectMapper pOM)
        throws SQLException {
        if (pOM == null) {
            throw new NullPointerException("ObjectMapper in readChildObjects "
                                           + "cannot be null!!");
        }

        for (Enumeration keys = pOM.mMapTypes.keys(); keys.hasMoreElements();) {
            String property = (String) keys.nextElement();
            String mapType = (String) pOM.mMapTypes.get(property);
	    
            if (property.length() <= 0 || mapType == null) {
                continue;
            }
	    
            // Get the id of the parent
            Object id = getPropertyValue(pParent, 
                                         pOM.getProperty(pOM.getPrimaryKey()));

            if (mapType.equals(ObjectMapper.OBJECTMAP)) {
                // OBJECT Mapping		

                // Get the class for this property
                Class objectClass = (Class) pOM.mClasses.get(property);
		
                DatabaseReadable dbr = null;
                try {
                    dbr = (DatabaseReadable) objectClass.newInstance();
                }
                catch (Exception e) {
                    mLog.logError(e);
                }
		
                /*
                  Properties mapping = readMapping(objectClass);
                */
		    
                // Get property mapping for child object
                if (pOM.mJoins.containsKey(property))
                    // mapping.setProperty(".join", (String) pOM.joins.get(property));
                    dbr.getMapping().put(".join", pOM.mJoins.get(property));
		
                // Find id and put in where hash
                Hashtable where = new Hashtable();

                // String foreignKey = mapping.getProperty(".foreignKey");
                String foreignKey = (String) 
                    dbr.getMapping().get(".foreignKey");

                if (foreignKey != null) {
                    where.put(".foreignKey", id);
                }

                Object[] child = readObjects(dbr, where);
                // Object[] child = readObjects(objectClass, mapping, where);

                if (child.length < 1)
                    throw new SQLException("No child object with foreign key "
                                           + foreignKey + "=" + id);
                else if (child.length != 1)
                    throw new SQLException("More than one object with foreign "
                                           + "key " + foreignKey + "=" + id);

                // Set child object to the parent
                setPropertyValue(pParent, property, child[0]);
            }
            else if (mapType.equals(ObjectMapper.COLLECTIONMAP)) {
                // COLLECTION Mapping

                // Get property mapping for child object
                Hashtable mapping = pOM.getPropertyMapping(property);

                // Find id and put in where hash
                Hashtable where = new Hashtable();
                String foreignKey = (String) mapping.get(".foreignKey");
                if (foreignKey != null) {
                    where.put(".foreignKey", id);
                }
		
                DBObject dbr = new DBObject();
                dbr.mapping = mapping; // ugh...
                // Read the objects
                Object[] objs = readObjects(dbr, where);

                // Put the objects in a hash
                Hashtable children = new Hashtable();
                for (int i = 0; i < objs.length; i++) {
                    children.put(((DBObject) objs[i]).getId(), 
                                 ((DBObject) objs[i]).getObject());
                }
		
                // Set child properties to parent object
                setPropertyValue(pParent, property, children);
            }
        }
    }
1175306
public void addSubtype(String subtype) {
    if(!StringUtils.isBlank(subtype) && !subtypes.contains(subtype.trim())) {
      subtypes.add(subtype.trim());
    }
  }
787522
function(elTh, oColumn) {
    SDT.superclass._initThEl.call(this, elTh, oColumn);
    elTh.id = this.getId() +"-fixedth-" + oColumn.getSanitizedKey(); // Needed for getColumn by TH and ColumnDD
}
194626
protected void init(Class<T> cls, Key ... keys) {
    	
		// get the columns 
        List<String> targetColumns = new ArrayList<String>();
        Class<?> clazz = cls;
        while( clazz != null && !clazz.equals(Object.class) ) {
            Field[] fields = clazz.getDeclaredFields();
            
            for( Field f : fields ) {
                int m = f.getModifiers();
            
                if( Modifier.isTransient(m) || Modifier.isStatic(m) ) {
                    continue;
                }
                if (f.getType().getName().equals(Collection.class.getName())) {
                	continue; // this is handled by dependency manager
                }
                if( !f.getType().getName().equals(Translator.class.getName()) ) {
                	targetColumns.add(f.getName());    
                	types.put(f.getName(), f.getType());
                }
            }
            clazz = clazz.getSuperclass();
        }
        
        columns = new String[targetColumns.size()];
        
        for (int i = 0; i < targetColumns.size(); i++) {
        	columns[i] = targetColumns.get(i);
        }        
    }
1367447
@Override
	public void setProperty(String name, Object value) {
		if(currentBeanConfig != null) {
			if(value instanceof GString)value = value.toString();
			if(addToDeferred(currentBeanConfig, name, value)) {
				return;
			}
			else if(value instanceof Closure) {
				BeanConfiguration current = currentBeanConfig;
				try {
					Closure callable = (Closure)value;

					Class parameterType = callable.getParameterTypes()[0];
					if(parameterType.equals(Object.class)) {
						currentBeanConfig = springConfig.createSingletonBean("");
						callable.call(new Object[]{currentBeanConfig});
					}
					else {
						currentBeanConfig = springConfig.createSingletonBean(parameterType);
						callable.call(null);
					}

					value = currentBeanConfig.getBeanDefinition();
				}
				finally {
					currentBeanConfig = current;
				}
			}
            currentBeanConfig.addProperty(name, value);
		} else {
            binding.put(name,value);
        }
	}
1179192
public void setSubProtocols(String[] subProtocols) {
        if (subProtocols == null || subProtocols.length == 0) {
            this.subProtocols = null;
            return;
        }
        this.subProtocols = Arrays.asList(subProtocols);
    }
1280582
function _fnColumnOptions( oSettings, iCol, oOptions )
		{
			var oCol = oSettings.aoColumns[ iCol ];
			
			/* User specified column options */
			if ( oOptions !== undefined && oOptions !== null )
			{
				if ( oOptions.sType !== undefined )
				{
					oCol.sType = oOptions.sType;
					oCol._bAutoType = false;
				}
				
				$.extend( oCol, oOptions );
				_fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );
		
				/* iDataSort to be applied (backwards compatibility), but aDataSort will take
				 * priority if defined
				 */
				if ( oOptions.iDataSort !== undefined )
				{
					oCol.aDataSort = [ oOptions.iDataSort ];
				}
				_fnMap( oCol, oOptions, "aDataSort" );
			}
		
			/* Cache the data get and set functions for speed */
			oCol.fnGetData = _fnGetObjectDataFn( oCol.mDataProp );
			oCol.fnSetData = _fnSetObjectDataFn( oCol.mDataProp );
			
			/* Feature sorting overrides column specific when off */
			if ( !oSettings.oFeatures.bSort )
			{
				oCol.bSortable = false;
			}
			
			/* Check that the class assignment is correct for sorting */
			if ( !oCol.bSortable ||
				 ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
			{
				oCol.sSortingClass = oSettings.oClasses.sSortableNone;
				oCol.sSortingClassJUI = "";
			}
			else if ( oCol.bSortable ||
			          ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
			{
			  oCol.sSortingClass = oSettings.oClasses.sSortable;
			  oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;
			}
			else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 )
			{
				oCol.sSortingClass = oSettings.oClasses.sSortableAsc;
				oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed;
			}
			else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 )
			{
				oCol.sSortingClass = oSettings.oClasses.sSortableDesc;
				oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed;
			}
		}
1111200
@Override
    public ClassNode visitType(TypeContext ctx) {
        if (!asBoolean(ctx)) {
            return ClassHelper.OBJECT_TYPE;
        }

        ClassNode classNode = null;

        if (asBoolean(ctx.classOrInterfaceType())) {
            ctx.classOrInterfaceType().putNodeMetaData(IS_INSIDE_INSTANCEOF_EXPR, ctx.getNodeMetaData(IS_INSIDE_INSTANCEOF_EXPR));
            classNode = this.visitClassOrInterfaceType(ctx.classOrInterfaceType());
        } else if (asBoolean(ctx.primitiveType())) {
            classNode = this.visitPrimitiveType(ctx.primitiveType());
        }

        if (!asBoolean(classNode)) {
            if (VOID_STR.equals(ctx.getText())) { // TODO refine error message for `void`
                throw createParsingFailedException("void is not allowed here", ctx);
            }

            throw createParsingFailedException("Unsupported type: " + ctx.getText(), ctx);
        }

        classNode.addAnnotations(this.visitAnnotationsOpt(ctx.annotationsOpt()));

        List<List<AnnotationNode>> dimList = this.visitDimsOpt(ctx.dimsOpt());
        if (asBoolean(dimList)) {
            // clear array's generics type info. Groovy's bug? array's generics type will be ignored. e.g. List<String>[]... p
            classNode.setGenericsTypes(null);
            classNode.setUsingGenerics(false);

            classNode = this.createArrayType(classNode, dimList);
        }

        return configureAST(classNode, ctx);
    }
471861
def insert(self, matcher, obj):
        '''
        
        '''
        current = self.subtree(matcher, True)
        #current.matchers[(obj, matcher)] = None
        if current._use_dict:
            current.matchers_dict[(obj, matcher)] = None
        else:
            current.matchers_list.append((obj, matcher))
        return current
1291896
public void field2inout(Object o, String field, Object comp) {
        field2inout(o, field, comp, field);
    }
845363
@Override
    public ORB createClientORB(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
        return createORB(translateToClientArgs(clientProps, subsystemFactories), translateToClientProps(clientProps, subsystemFactories));
    }