Skip to Content.
Sympa Menu

notify-dpml - r1974 - trunk/main/depot/library/src/main/dpml/library/info

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1974 - trunk/main/depot/library/src/main/dpml/library/info
  • Date: Mon, 16 Apr 2007 22:24:51 +0200

Author: mcconnell
Date: 2007-04-16 22:24:50 +0200 (Mon, 16 Apr 2007)
New Revision: 1974

Modified:
trunk/main/depot/library/src/main/dpml/library/info/LibraryDecoder.java
Log:
improved error handling with production <type> declaration decoding

Modified:
trunk/main/depot/library/src/main/dpml/library/info/LibraryDecoder.java
===================================================================
--- trunk/main/depot/library/src/main/dpml/library/info/LibraryDecoder.java
2007-04-16 17:06:51 UTC (rev 1973)
+++ trunk/main/depot/library/src/main/dpml/library/info/LibraryDecoder.java
2007-04-16 20:24:50 UTC (rev 1974)
@@ -687,15 +687,32 @@

private TypeDirective buildTypeDirective( Element element ) throws
Exception
{
- final String id = getID( element );
- final Properties properties = getProperties( element );
- final String version = getVersion( element );
- final String source = getSource( element );
- final String name = ElementHelper.getAttribute( element, "name" );
- boolean alias = getAliasPolicy( element );
- boolean export = getExportPolicy( element );
- ProductionPolicy production = getProductionPolicy( element );
- return new TypeDirective( production, id, name, version, alias,
source, properties, export );
+ String tag = element.getTagName();
+ if( "type".equals( tag ) )
+ {
+ final String id = getID( element );
+ final Properties properties = getProperties( element );
+ final String version = getVersion( element );
+ final String source = getSource( element );
+ final String name = ElementHelper.getAttribute( element, "name"
);
+ boolean alias = getAliasPolicy( element );
+ boolean export = getExportPolicy( element );
+ ProductionPolicy production = getProductionPolicy( element );
+ return new TypeDirective( production, id, name, version, alias,
source, properties, export );
+ }
+ else if( "component".equals( tag ) )
+ {
+ final String error =
+ "In-line declaration of a component strategy not supported."
+ + "\nUse <type id=\"part\" source=\"etc/component.xml\"/>.";
+ throw new DecodingException( error, element );
+ }
+ else
+ {
+ final String error =
+ "Illegal element name (expecting <type>).";
+ throw new DecodingException( error, element );
+ }
}

private String getVersion( Element element )




  • r1974 - trunk/main/depot/library/src/main/dpml/library/info, mcconnell at BerliOS, 04/16/2007

Archive powered by MHonArc 2.6.24.

Top of Page