myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r634677 - in /myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm: jsf/component/ metadata/ metadata/impl/ metadata/impl/ejb/ metadata/impl/hibernate/ metadata/impl/jsf/
Date Fri, 07 Mar 2008 13:54:50 GMT
Author: skitching
Date: Fri Mar  7 05:54:48 2008
New Revision: 634677

URL: http://svn.apache.org/viewvc?rev=634677&view=rev
Log:
More packaging cleanups

Added:
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaDataWritable.java
  (with props)
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaFieldWritable.java
  (with props)
Modified:
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/Extractor.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaData.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaField.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaDataImpl.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaFieldImpl.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/hibernate/HibernateExtractor.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/AbstractJsfExtractor.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExclusiveExtractor.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExtractor.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfRequestFieldExtractor.java

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java
Fri Mar  7 05:54:48 2008
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.orchestra.dynaForm.jsf.component;
 
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaFieldImpl;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIComponentBase;
@@ -186,7 +186,7 @@
 			};
 	}
 
-	public void configureMetaData(MetaFieldImpl field)
+	public void configureMetaData(MetaFieldWritable field)
 	{
 		if (getDisplaySize() != null)
 		{

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/Extractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/Extractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/Extractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/Extractor.java
Fri Mar  7 05:54:48 2008
@@ -18,16 +18,9 @@
  */
 package org.apache.myfaces.orchestra.dynaForm.metadata;
 
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaDataImpl;
-
 /**
- * An interface to a perstence-library-specific adapter class that knows how
- * to create a MetaData object from the data held by that specific persistence
- * library.
- * <p>
- * TODO: Why is this class returning instances of concrete class MetaData,
- * rather than the interface? What is the point of the interface if this
- * class doesn't use it?
+ * An interface implemented by objects that can inspect an arbitrary object
+ * and extract metadata about its properties.
  */
 public interface Extractor
 {
@@ -40,6 +33,5 @@
 	 * new data overwrites the old data. A chain of Extractors can therefore
 	 * be used (in the correct order) to control exactly what metadata applies.
 	 */
-	// TODO: this is a packaging violation; fix!
-	public void getMetaData(MetaDataImpl metaData, Object entity);
+	public void getMetaData(MetaDataWritable metaData, Object entity);
 }

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaData.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaData.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaData.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaData.java
Fri Mar  7 05:54:48 2008
@@ -21,6 +21,7 @@
 import java.util.Iterator;
 
 /**
+ * A read-only view of metadata about a particular entity.
  */
 public interface MetaData
 {

Added: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaDataWritable.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaDataWritable.java?rev=634677&view=auto
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaDataWritable.java
(added)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaDataWritable.java
Fri Mar  7 05:54:48 2008
@@ -0,0 +1,91 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.orchestra.dynaForm.metadata;
+
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * A writable implementation of the MetaData interface that is initialised
+ * by Extractor objects, and then read by other objects that need information
+ * about the available properties.
+ * <p>
+ * An instance of this class is created and then passed to a list of one or
+ * more Extractor objects, together with a source object to be introspected.
+ * The extractor instances deduce information about fields of the source
+ * object and then add or update MetaField objects held by the MetaDataImpl.
+ * <p>
+ * An instance of MetaDataImpl is then typically cast to the read-only
+ * MetaData interface type and passed to objects that make use of the 
+ * gathered metadata, such as dynaform "gui builders". 
+ */
+public interface MetaDataWritable extends MetaData
+{
+	/**
+	 * Indicate whether the field with the specified name should be
+	 * used or ignored.
+	 *
+	 * @see #setLockFields(boolean)
+	 */
+	public boolean isWantedField(String name);
+
+	/**
+			// we processed this field due to the fact that it was the parent of a requestedField
+	 * should this field be processed.
+	 *
+	 * @return true if the given name is the parent of one of the requestedFields
+	 * @see #processField(String)
+	 * @see #setLockFields(boolean)
+	 */
+	public boolean isParentOfWantedField(String name);
+
+	/**
+	 * request to add this field if we reach it. eg. used to trigger traversing the object graph
for
+	 * linked entities
+	 * <p>
+	 * Name may be of form "foo.bar.baz"
+	 */
+	public void requestField(String name);
+
+	public Set<String> getRequestedFields();
+
+	/**
+	 * add a new field to the metadata or return one if one already exists for
+	 * the given name
+	 */
+	public MetaFieldWritable getOrCreateField(String name);
+
+	public int getFieldCount();
+
+	public Iterator<String> iterFieldNames();
+
+	public MetaField getField(String name);
+
+	public String[] getFieldNames();
+
+	/**
+	 * Prevent the adding of any new MetaField objects to this instance (but
+	 * enhancing existing fields is permitted).
+	 * <p>
+	 * When set to true, any call to isProcessableField will return false for names
+	 * that are not already known, and getOrCreateField will throw an exception if
+	 * the field does not exist.
+	 */
+	public boolean setLockFields(boolean lockFields);
+}

Propchange: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaDataWritable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaField.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaField.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaField.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaField.java
Fri Mar  7 05:54:48 2008
@@ -26,8 +26,10 @@
 import org.apache.myfaces.orchestra.dynaForm.lib.SelectionSourceEnum;
 
 /**
- * Provides the DynaForm with meta-data about a single property of a
- * persistent entity.
+ * Rad-only representation of meta-data about a single property of an entity.
+ * <p>
+ * This is similar to java.beans.PropertyDescriptor, but customised for the
+ * needs of the DynaForm component.
  */
 public interface MetaField
 {
@@ -61,12 +63,15 @@
 
 	public Selection[] getAllowedSelections();
 
-	// Set to NONE for normal properties, or a different value for
-	// properties that hold a reference to some other persistent entity.
+	/**
+	 * Indicates whether this property is a <i>relation</i> to some other object.
+	 * <p>
+	 * For primitive fields, this returns NONE.
+	 */
 	public RelationType getRelationType();
 
 	/**
-	 * in case of hierarchical structures this defines if a child class should be treatened
+	 * In case of hierarchical structures this defines if a child class should be treatened
 	 * as "embedded".<br />
 	 * <ul>
 	 * <li>Embedded: like a composite key in hibernate</li>
@@ -81,7 +86,10 @@
 	// OR: does this also limit # of chars for numeric and date fields?
 	public Integer getMaxSize();
 
-	// Used only for numeric fields. Limits the maximum value.
+	/**
+	 * For numeric fields, this specifies the maximum value permitted for this field.
+	 * Returns null for non-numeric fields.
+	 */
 	public Double getMaxValue();
 
 	// Used only for text fields. Limits the number of characters.
@@ -93,7 +101,10 @@
 	// usually allow scrolling internally.
 	public Integer getDisplaySize();
 
-	// Used only for numeric fields. Limits the maximum value.
+	/**
+	 * For numeric fields, this specifies the minimum value permitted for this field.
+	 * Returns null for non-numeric fields.
+	 */
 	public Double getMinValue();
 
 	// Explicitly allow control over what JSF component is created to

Added: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaFieldWritable.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaFieldWritable.java?rev=634677&view=auto
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaFieldWritable.java
(added)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaFieldWritable.java
Fri Mar  7 05:54:48 2008
@@ -0,0 +1,64 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.orchestra.dynaForm.metadata;
+
+import javax.faces.component.UIComponent;
+import javax.faces.convert.Converter;
+import javax.persistence.TemporalType;
+
+import org.apache.myfaces.orchestra.dynaForm.jsf.guiBuilder.DynaFormComponentHandler;
+import org.apache.myfaces.orchestra.dynaForm.lib.SelectionSourceEnum;
+
+
+/**
+ * Metadata for a field
+ */
+public interface MetaFieldWritable extends MetaField
+{
+	public void setPreferredExternalName(String preferredExternalName);
+	public void setType(Class<?> type);
+	public void setDisplayOnly(Boolean displayOnly);
+	public void setCanRead(boolean canRead);
+	public void setCanWrite(boolean canWrite);
+	public void setDisabled(boolean disabled);
+	public void setRequired(boolean nullable);
+	public void setAllowedSelections(Selection[] allowedSelections);
+	public void setRelationType(RelationType relationType);
+	public void setMaxSize(Integer maxSize);
+	public void setMaxValue(Double maxValue);
+	public void setMinSize(Integer minSize);
+	public void setMinValue(Double minValue);
+	public void setWantedComponent(UIComponent component);
+	public void setWantedComponentType(FieldRepresentation componentType);
+	public void setDisplaySize(int displaySize);
+	public void setTemporalType(TemporalType temporalType);
+	public void setAllowMultipleSelections(boolean allowMultipleSelections);
+	public void setSelectionSource(SelectionSourceEnum selectionSource);
+    public void setEntityType(boolean entityType);
+    public void setId(boolean id);
+	public void setEmbedded(boolean embedded);
+	public void setDataSource(String dataSource);
+	public void setDataSourceDescription(String dataSourceDescription);
+	public void setConverterId(String converterId);
+	public void setConverterClass(Class<Converter> converterClass);
+	public void setConverterBean(String converterBean);
+	public void setComponentHandler(DynaFormComponentHandler componentHandler);
+	public void setAttribute(String name, Object value);
+}
+

Propchange: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/MetaFieldWritable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaDataImpl.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaDataImpl.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaDataImpl.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaDataImpl.java
Fri Mar  7 05:54:48 2008
@@ -25,24 +25,28 @@
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.myfaces.orchestra.dynaForm.metadata.MetaData;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaDataWritable;
 import org.apache.myfaces.orchestra.dynaForm.metadata.MetaField;
 
 /**
- * A convenient implementation of the MetaDataInterface that implementations
- * of the Extractor interface can use.
+ * A convenience implementation of the MetaDataWritable interface.
  * <p>
- * An instance of this type can be created by an Extractor to represent the
- * metadata for a specific class.
+ * An instance of this type can be created and then passed to a list of one or
+ * more Extractor objects, together with a source object to be introspected.
+ * The extractor instances deduce information about fields of the source
+ * object and then add or update MetaField objects held by the MetaDataImpl.
  * <p>
- * TODO: Rename this to MetaDataImpl, and move to the impl package.
- * It isn't specific to any particular implementation, but is a concrete
- * class rather than an interface.
+ * The resulting populated object is then typically cast to the read-only
+ * MetaData interface type and passed to objects that make use of the 
+ * gathered metadata, such as dynaform "gui builders". 
  */
-public class MetaDataImpl implements MetaData
+public class MetaDataImpl implements MetaDataWritable
 {
 	private final Set<String> requestedFields = new TreeSet<String>();
 	private final Set<String> requestedFieldParents = new TreeSet<String>();
+	
+	// Here, a LinkedHashMap is used to ensure that fields can be iterated over
+	// in the order in which they were added to the map.
 	private final Map<String, MetaFieldImpl> fields = new LinkedHashMap<String, MetaFieldImpl>();
 
 	private boolean lockFields = false;
@@ -52,30 +56,49 @@
 	}
 
 	/**
-	 * should this field be processed
+	 * Indicates whether metadata about this field is wanted.
+	 * <p>
+	 * If this object is not "locked", then this always returns true.
+	 * <p>
+	 * Even when locked, this returns true if:
+	 * <ul>
+	 * <li>The field is already added to this object, or
+	 * <li>The field has explicitly been "requested", or
+	 * <li>The name is of form "foo.bar", and "foo.bar.baz" has
+	 *  been added to the "requested" fields. 
+	 * </ul>
 	 *
 	 * @see #setLockFields(boolean)
 	 */
-	public boolean processField(String name)
+	public boolean isWantedField(String name)
 	{
-		return !lockFields || processFieldParent(name) || requestedFields.contains(name) || fields.containsKey(name);
+		return !lockFields 
+			|| isParentOfWantedField(name)
+			|| requestedFields.contains(name)
+			|| fields.containsKey(name);
 	}
 
 	/**
-	 * should this field be processed.
+	 * Is metadata about this field wanted because some child field of this
+	 * field has explicitly been marked as requested?
 	 *
 	 * @return true if the given name is the parent of one of the requestedFields
 	 * @see #processField(String)
 	 * @see #setLockFields(boolean)
 	 */
-	public boolean processFieldParent(String name)
+	public boolean isParentOfWantedField(String name)
 	{
 		return requestedFieldParents.contains(name);
 	}
 
 	/**
-	 * request to add this field if we reach it. eg. used to trigger traversing the object graph
for
-	 * linked entities
+	 * Allow a field to be added to this object even after this MetaData object is
+	 * "locked" for field addition.
+	 * <p>
+	 * This is used when traversing the object graph for linked entities.
+	 * <p>
+	 * When a name like "foo.bar.baz" is passed to this method, the requestedFieldsParent
+	 * list has "foo" and "foo.bar" added to it. 
 	 */
 	public void requestField(String name)
 	{
@@ -99,12 +122,12 @@
 	}
 
 	/**
-	 * add a new field to the metadata or return one if one already exists for
+	 * Add a new field to the metadata or return one if one already exists for
 	 * the given name
 	 */
 	public MetaFieldImpl getOrCreateField(String name)
 	{
-		if (!processField(name))
+		if (!isWantedField(name))
 		{
 			throw new SecurityException("Current state do not allow to add the field: " + name);
 		}

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaFieldImpl.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaFieldImpl.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaFieldImpl.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/MetaFieldImpl.java
Fri Mar  7 05:54:48 2008
@@ -29,7 +29,7 @@
 import org.apache.myfaces.orchestra.dynaForm.jsf.guiBuilder.DynaFormComponentHandler;
 import org.apache.myfaces.orchestra.dynaForm.lib.SelectionSourceEnum;
 import org.apache.myfaces.orchestra.dynaForm.metadata.FieldRepresentation;
-import org.apache.myfaces.orchestra.dynaForm.metadata.MetaField;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 import org.apache.myfaces.orchestra.dynaForm.metadata.RelationType;
 import org.apache.myfaces.orchestra.dynaForm.metadata.Selection;
 
@@ -37,7 +37,7 @@
 /**
  * Metadata for a field
  */
-public class MetaFieldImpl implements MetaField, Serializable
+class MetaFieldImpl implements MetaFieldWritable, Serializable
 {
 	private final String name;
 	private final String baseName;

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
Fri Mar  7 05:54:48 2008
@@ -63,10 +63,10 @@
 //TODO: fix this import; this non-jsf class should not import jsf-specific stuff
 import org.apache.myfaces.orchestra.dynaForm.jsf.guiBuilder.DynaFormComponentHandler;
 import org.apache.myfaces.orchestra.dynaForm.metadata.Extractor;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaDataWritable;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 import org.apache.myfaces.orchestra.dynaForm.metadata.RelationType;
 import org.apache.myfaces.orchestra.dynaForm.metadata.Selection;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaDataImpl;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaFieldImpl;
 import org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter;
 
 /**
@@ -191,7 +191,7 @@
 	 * <p>
 	 * The specified class and its ancestors are inspected for JPA annotations, and
 	 */
-	public void getMetaData(MetaDataImpl metaData, Object entity)
+	public void getMetaData(MetaDataWritable metaData, Object entity)
 	{
 		if (!(entity instanceof String))
 		{
@@ -236,7 +236,7 @@
 	 * create the metadata for the given class
 	 */
 	@SuppressWarnings("unchecked")
-	protected void create(Context context, MetaDataImpl metaData, Class entityClass)
+	protected void create(Context context, MetaDataWritable metaData, Class entityClass)
 	{
 		/* do not check if this is really a entity. this allows us to parse any given bean
 		if (!entityClass.isAnnotationPresent(Entity.class))
@@ -335,7 +335,7 @@
 	/**
 	 * ejb3 access through fields
 	 */
-	protected void initFromFields(Context context, MetaDataImpl metaData, Field[] fields)
+	protected void initFromFields(Context context, MetaDataWritable metaData, Field[] fields)
 	{
 		for (Field field : fields)
 		{
@@ -350,7 +350,7 @@
 			String name = field.getName();
 			Class<?> type = field.getType();
 
-			if (metaData.processField(createFullName(context, name)))
+			if (metaData.isWantedField(createFullName(context, name)))
 			{
 				processField(context, metaData, field, name, type, true, true);
 			}
@@ -360,7 +360,7 @@
 	/**
 	 * process the given field - or ist superclass if it is embedded
 	 */
-	protected void processField(Context context, MetaDataImpl metaData, AccessibleObject accessibleObject,

+	protected void processField(Context context, MetaDataWritable metaData, AccessibleObject
accessibleObject, 
 			String name, Class<?> type, Boolean canRead, Boolean canWrite)
 	{
 		if (accessibleObject.isAnnotationPresent(IgnoreProperty.class))
@@ -375,7 +375,7 @@
 			return;
 		}
 
-		if (metaData.processFieldParent(name))
+		if (metaData.isParentOfWantedField(name))
 		{
 			// we processed this field due to the fact that it was the parent of a requestedField
 			embeddEntity(context, metaData, name, type);
@@ -383,7 +383,7 @@
 			return;
 		}
 
-		MetaFieldImpl mdField = metaData.getOrCreateField(createFullName(context, name));
+		MetaFieldWritable mdField = metaData.getOrCreateField(createFullName(context, name));
 		mdField.setType(type);
 		if (canRead != null && mdField.getCanRead() == null)
 		{
@@ -398,7 +398,7 @@
 		initFromAnnotations(context, mdField, accessibleObject);
 	}
 
-	protected boolean processEmbedded(Context context, MetaDataImpl metaData, AccessibleObject
accessibleObject,
+	protected boolean processEmbedded(Context context, MetaDataWritable metaData, AccessibleObject
accessibleObject,
 			String name, Class<?> type)
 	{
 		if (accessibleObject.isAnnotationPresent(Embedded.class) || accessibleObject.isAnnotationPresent(Id.class)
|| accessibleObject.isAnnotationPresent(EmbeddedId.class))
@@ -428,7 +428,7 @@
 	/**
 	 * check if we should embedd this entity
 	 */
-	protected boolean checkEmbeddEntity(Context context, MetaDataImpl metaData, String name)
+	protected boolean checkEmbeddEntity(Context context, MetaDataWritable metaData, String name)
 	{
 		String checkName = createFullName(context, name) + ".";
 
@@ -458,7 +458,7 @@
 	/**
 	 * embedd this entity
 	 */
-	protected void embeddEntity(Context context, MetaDataImpl metaData, String name, Class<?>
entityType)
+	protected void embeddEntity(Context context, MetaDataWritable metaData, String name, Class<?>
entityType)
 	{
 		// process embedded type
 		boolean previousLock = false;
@@ -482,7 +482,7 @@
 	/**
 	 * init metadata from annotations
 	 */
-	protected void initFromAnnotations(Context context, MetaFieldImpl mdField, AccessibleObject
accessibleObject)
+	protected void initFromAnnotations(Context context, MetaFieldWritable mdField, AccessibleObject
accessibleObject)
 	{
 		if (accessibleObject.isAnnotationPresent(DisplayOnly.class))
 		{
@@ -656,7 +656,7 @@
 	/**
 	 * configure a special fields as disabled. e.g. used for Id, Version, ....
 	 */
-	protected void setSpecialFieldDisabled(MetaFieldImpl mdField)
+	protected void setSpecialFieldDisabled(MetaFieldWritable mdField)
 	{
 		mdField.setCanWrite(false);
 		mdField.setDisabled(true);
@@ -665,7 +665,7 @@
 	/**
 	 * ejb3 access through methods (properties)
 	 */
-	protected void initFromMethods(Context context, MetaDataImpl metaData, Method[] methods)
+	protected void initFromMethods(Context context, MetaDataWritable metaData, Method[] methods)
 	{
 		for (Method method : methods)
 		{
@@ -681,7 +681,7 @@
 			String methodName = method.getName();
 			String propertyName = convertMethodName(methodName);
 
-			if (!metaData.processField(createFullName(context, propertyName)))
+			if (!metaData.isWantedField(createFullName(context, propertyName)))
 			{
 				continue;
 			}
@@ -712,7 +712,7 @@
 					continue;
 				}
 
-				if (metaData.processField(createFullName(context, propertyName)))
+				if (metaData.isWantedField(createFullName(context, propertyName)))
 				{
 					processField(context, metaData, method, propertyName, method.getParameterTypes()[0],
null, true);
 				}
@@ -721,7 +721,7 @@
 	}
 
 	@SuppressWarnings("unchecked")
-	protected void initFromType(Context context, MetaFieldImpl mdField, Class type)
+	protected void initFromType(Context context, MetaFieldWritable mdField, Class type)
 	{
 		if (type.isEnum())
 		{

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/hibernate/HibernateExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/hibernate/HibernateExtractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/hibernate/HibernateExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/hibernate/HibernateExtractor.java
Fri Mar  7 05:54:48 2008
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.orchestra.dynaForm.metadata.impl.hibernate;
 
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaFieldImpl;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 import org.apache.myfaces.orchestra.dynaForm.metadata.impl.ejb.EjbExtractor;
 
 import java.lang.reflect.AccessibleObject;
@@ -29,7 +29,7 @@
 public class HibernateExtractor extends EjbExtractor
 {
 	@Override
-	protected void initFromAnnotations(Context context, MetaFieldImpl mdField, AccessibleObject
accessibleObject)
+	protected void initFromAnnotations(Context context, MetaFieldWritable mdField, AccessibleObject
accessibleObject)
 	{
 		throw new UnsupportedOperationException();
 

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/AbstractJsfExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/AbstractJsfExtractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/AbstractJsfExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/AbstractJsfExtractor.java
Fri Mar  7 05:54:48 2008
@@ -24,8 +24,8 @@
 import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaConfigs;
 import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaForm;
 import org.apache.myfaces.orchestra.dynaForm.metadata.Extractor;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaDataImpl;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaFieldImpl;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaDataWritable;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 
 /**
  * Extract metadata from a DynaForm UIComponent.
@@ -47,7 +47,7 @@
 	 * <p>
 	 * The specified entity must be an instance of DynaForm (a JSF UIComponent).
 	 */
-	public void getMetaData(MetaDataImpl metaData, Object entity)
+	public void getMetaData(MetaDataWritable metaData, Object entity)
 	{
 		if (!(entity instanceof DynaForm))
 		{
@@ -61,7 +61,7 @@
 	 * create the metadata out of the dynaConfigs for the given component
 	 */
 	@SuppressWarnings("unchecked")
-	protected void create(MetaDataImpl metaData, DynaForm dynaForm)
+	protected void create(MetaDataWritable metaData, DynaForm dynaForm)
 	{
 		DynaConfigs formConfig = dynaForm.getFormConfigs();
 		if (formConfig == null)
@@ -79,14 +79,14 @@
 				throw new IllegalArgumentException("'for' in config tag required");
 			}
 
-			if (metaData.processField(name))
+			if (metaData.isWantedField(name))
 			{
-				MetaFieldImpl field = metaData.getOrCreateField(name);
+				MetaFieldWritable field = metaData.getOrCreateField(name);
 
 				initFromConfig(field, dynaConfig);
 			}
 		}
 	}
 
-	protected abstract void initFromConfig(MetaFieldImpl field, DynaConfig config);
+	protected abstract void initFromConfig(MetaFieldWritable field, DynaConfig config);
 }

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExclusiveExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExclusiveExtractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExclusiveExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExclusiveExtractor.java
Fri Mar  7 05:54:48 2008
@@ -20,7 +20,7 @@
 
 
 import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaConfig;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaFieldImpl;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 
 /**
  * Extract metadata from jsf form.<br />
@@ -33,7 +33,7 @@
 	{
 	}
 
-	protected void initFromConfig(MetaFieldImpl field, DynaConfig config)
+	protected void initFromConfig(MetaFieldWritable field, DynaConfig config)
 	{
 	}
 }

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExtractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfExtractor.java
Fri Mar  7 05:54:48 2008
@@ -20,7 +20,7 @@
 
 
 import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaConfig;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaFieldImpl;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaFieldWritable;
 
 /**
  * Extract metadata from jsf form.<br />
@@ -32,7 +32,7 @@
 	{
 	}
 
-	protected void initFromConfig(MetaFieldImpl field, DynaConfig config)
+	protected void initFromConfig(MetaFieldWritable field, DynaConfig config)
 	{
 		config.configureMetaData(field);
 	}

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfRequestFieldExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfRequestFieldExtractor.java?rev=634677&r1=634676&r2=634677&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfRequestFieldExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/jsf/JsfRequestFieldExtractor.java
Fri Mar  7 05:54:48 2008
@@ -25,7 +25,7 @@
 import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaConfigs;
 import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaForm;
 import org.apache.myfaces.orchestra.dynaForm.metadata.Extractor;
-import org.apache.myfaces.orchestra.dynaForm.metadata.impl.MetaDataImpl;
+import org.apache.myfaces.orchestra.dynaForm.metadata.MetaDataWritable;
 
 /**
  * Extract metadata from jsf form.<br />
@@ -38,7 +38,7 @@
 	{
 	}
 
-	public void getMetaData(MetaDataImpl metaData, Object entity)
+	public void getMetaData(MetaDataWritable metaData, Object entity)
 	{
 		if (!(entity instanceof DynaForm))
 		{
@@ -52,7 +52,7 @@
 	 * create the metadata out of the dynaConfigs for the given component
 	 */
 	@SuppressWarnings("unchecked")
-	protected void create(MetaDataImpl metaData, DynaForm dynaForm)
+	protected void create(MetaDataWritable metaData, DynaForm dynaForm)
 	{
 		DynaConfigs formConfig = dynaForm.getFormConfigs();
 		if (formConfig == null)
@@ -70,7 +70,7 @@
 				throw new IllegalArgumentException("'for' in config tag required");
 			}
 
-			if (metaData.processField(name))
+			if (metaData.isWantedField(name))
 			{
 				metaData.requestField(name);
 			}



Mime
View raw message