| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Commons Modeler example source code file (

This example Commons Modeler source code file ( is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Commons Modeler tags/keywords

arraylist, featureinfo, fieldinfo, fieldinfo, io, iterator, list, list, management, serializable, serializable, string, string, util

The Commons Modeler source code

 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.

package org.apache.commons.modeler;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


 * <p>Convenience base class for AttributeInfo,
 * <code>ConstructorInfo, and OperationInfo classes
 * that will be used to collect configuration information for the
 * <code>ModelMBean beans exposed for management.

* * @author Craig R. McClanahan * @version $Revision: 480402 $ $Date: 2006-11-29 04:43:23 +0000 (Wed, 29 Nov 2006) $ */ public class FeatureInfo implements Serializable { static final long serialVersionUID = -911529176124712296L; protected String description = null; protected List fields = new ArrayList(); protected String name = null; // ------------------------------------------------------------- Properties /** * The human-readable description of this feature. */ public String getDescription() { return (this.description); } public void setDescription(String description) { this.description = description; } /** * The field information for this feature. */ public List getFields() { return (fields); } /** * The name of this feature, which must be unique among features in the * same collection. */ public String getName() { return (; } public void setName(String name) { = name; } // --------------------------------------------------------- Public Methods /** * <p>Add a new field to the fields associated with the * Descriptor that will be created from this metadata.</p> * * @param field The field to be added */ public void addField(FieldInfo field) { fields.add(field); } // ------------------------------------------------------ Protected Methods /** * <p>Add the name/value fields that have been stored into the * specified <code>Descriptor instance.

* * @param descriptor The <code>Descriptor to add fields to */ protected void addFields(Descriptor descriptor) { Iterator items = getFields().iterator(); while (items.hasNext()) { FieldInfo item = (FieldInfo); descriptor.setField(item.getName(), item.getValue()); } } }

Other Commons Modeler examples (source code examples)

Here is a short list of links related to this Commons Modeler source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.