notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1027 - trunk/main/metro/tools/src/main/net/dpml/metro/tools
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1027 - trunk/main/metro/tools/src/main/net/dpml/metro/tools
- Date: Sat, 4 Feb 2006 20:42:01 +0100
Author: mcconnell
Date: 2006-02-04 20:41:12 +0100 (Sat, 04 Feb 2006)
New Revision: 1027
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
Log:
housekeeping
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
2006-02-04 19:21:35 UTC (rev 1026)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
2006-02-04 19:41:12 UTC (rev 1027)
@@ -42,6 +42,7 @@
*/
public void setClass( final String classname )
{
+ System.out.println( "SET CLASSNAME: " + classname );
m_classname = classname;
}
@@ -71,6 +72,7 @@
*/
public ArrayDataType createArray()
{
+ System.out.println( "CREATE ARRAY" );
final ArrayDataType param = new ArrayDataType();
m_params.add( param );
return param;
@@ -84,21 +86,33 @@
{
return (ValueBuilder[]) m_params.toArray( new ValueBuilder[0] );
}
-
+
/**
* Build a value datastructure.
* @return the serializable value descriptor
*/
- public Value buildValue()
+ public Value buildValue( String classname )
{
- String classname = getClassname();
ValueBuilder[] params = getValueBuilders();
Value[] values = new Value[ params.length ];
for( int i=0; i<values.length; i++ )
{
ValueBuilder p = params[i];
- values[i] = p.buildValue();
+ values[i] = p.buildValue( classname );
}
- return new Array( classname, values );
+ String cname = getClassname( classname );
+ return new Array( cname, values );
}
+
+ String getClassname( String fallback )
+ {
+ if( null == m_classname )
+ {
+ return fallback;
+ }
+ else
+ {
+ return m_classname;
+ }
+ }
}
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
2006-02-04 19:21:35 UTC (rev 1026)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
2006-02-04 19:41:12 UTC (rev 1027)
@@ -268,7 +268,7 @@
for( int i=0; i<params.length; i++ )
{
ValueBuilder p = params[i];
- values[i] = p.buildValue();
+ values[i] = p.buildValue( classname );
}
return new ValueDirective( classname, method, values );
}
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
2006-02-04 19:21:35 UTC (rev 1026)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
2006-02-04 19:41:12 UTC (rev 1027)
@@ -31,7 +31,9 @@
{
/**
* Build a value datastructure.
+ * @param classname the default classname
* @return the serializable value descriptor
*/
- Value buildValue();
+ Value buildValue( String classname );
+
}
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
2006-02-04 19:21:35 UTC (rev 1026)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
2006-02-04 19:41:12 UTC (rev 1027)
@@ -126,11 +126,12 @@
/**
* Build a value datastructure.
+ * @param name the default classname
* @return the serializable value descriptor
*/
- public Value buildValue()
+ public Value buildValue( String name )
{
- String classname = getClassname();
+ String classname = getClassname( name );
String method = getMethodName();
String value = getValue();
if( null != value )
@@ -144,37 +145,21 @@
for( int i=0; i<values.length; i++ )
{
ValueBuilder p = params[i];
- values[i] = p.buildValue();
+ values[i] = p.buildValue( classname );
}
return new ValueDirective( classname, method, values );
}
}
-
- /**
- * Create a construct for the datatype.
- * @return the construct
- */
- /*
- public Construct newConstruct()
+
+ String getClassname( String fallback )
{
- String classname = getClassname();
- String method = getMethodName();
- String value = getValue();
- if( null != value )
- {
- return new Construct( classname, method, value );
+ if( null == m_classname )
+ {
+ return fallback;
}
else
{
- ValueDataType[] params = getValueDataTypes();
- Construct[] values = new Construct[ params.length ];
- for( int i=0; i<values.length; i++ )
- {
- ValueDataType p = params[i];
- values[i] = p.newConstruct();
- }
- return new Construct( classname, method, values );
+ return m_classname;
}
}
- */
}
- r1027 - trunk/main/metro/tools/src/main/net/dpml/metro/tools, mcconnell at BerliOS, 02/04/2006
Archive powered by MHonArc 2.6.24.