User: ko5tik
Date: 02/07/14 08:27:59
Modified: src/java/xtags ConditionFactory.java
Log:
GUI es ModuleLoader to find module info
Revision Changes Path
1.13 +40 -22 xdocletgui/src/java/xtags/ConditionFactory.java
Index: ConditionFactory.java
===================================================================
RCS file: /cvsroot/xdoclet/xdocletgui/src/java/xtags/ConditionFactory.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -r1.12 -r1.13
--- ConditionFactory.java 2 May 2002 17:35:14 -0000 1.12
+++ ConditionFactory.java 14 Jul 2002 15:27:59 -0000 1.13
@@ -15,6 +15,9 @@
import xtags.condition.*;
+import xdoclet.loader.ModuleFinder;
+import xdoclet.loader.XDocletModule;
+
/**
* Factory for tag families. Reads and parses XML descriptor.
*
@@ -40,6 +43,8 @@
*/
private Document _document;
+ private TagFamilies _tagFamilies = null;
+
static
{
_conditionTypes.setProperty( "not", "xtags.condition.Not" );
@@ -60,19 +65,24 @@
}
/**
- * Describe what the ConditionFactory constructor does
- *
- * @exception JDOMException Describe the exception
* @todo-javadoc Write javadocs for constructor
* @todo-javadoc Write javadocs for exception
*/
- public ConditionFactory() throws JDOMException
+ public ConditionFactory()
{
- URL xml = getClass().getResource( "/xdoclet-tags.xml" );
+ //URL xml = getClass().getResource( "/xdoclet-tags.xml" );
+
+ // read( xml );
+ ModuleFinder.initClasspath( getClass() );
+ _tagFamilies = new TagFamilies();
- read( xml );
+ createConfigurations();
}
+ public TagFamilies getTagFamilies()
+ {
+ return _tagFamilies;
+ }
/**
* Creates a Configurations object. This object knows about all tags and tag
* parameters accepted by xdoclet. It also knows what tags and parameters apply
@@ -80,25 +90,33 @@
* source class will have an attached deep clone of Configurations, which will
* be used to create a gui that can be used for configuration.
*
- * @return tag families created from configured XML
- * descriptors
- * @exception ConditionException throws when something went really wrong
- * during parsing
- * @todo rename to Configurations
- * createConfigurations()
+ * @todo rename to Configurations createConfigurations()
*/
- public TagFamilies createConfigurations() throws ConditionException
+ public void createConfigurations()
+ {
+ List modules = ModuleFinder.findModules();
+ Iterator i = modules.iterator();
+
+ while( i.hasNext() )
{
+ XDocletModule module = ( XDocletModule ) i.next();
+
+ createConfiguration( module.getXTagsDefinitionURL() );
+ }
+ }
+ void createConfiguration( URL xtagsURL )
+ {
try
{
- TagFamilies tagFamilies = new TagFamilies();
+ read( xtagsURL );
Element rootElement = _document.getRootElement();
List namespaceElement = rootElement.getChildren( "namespace" );
for( Iterator tagshandlerIterator =
namespaceElement.iterator(); tagshandlerIterator.hasNext(); )
{
+
Element tagshandlerElement = ( Element )
tagshandlerIterator.next();
// example: weblogic. typically corresponds to a gui
tab
@@ -120,7 +138,7 @@
TagFamily tagFamily = new TagFamily( namespaceName,
namespaceUsage, namespaceConditionDescription, namespaceCondition );
- tagFamilies.add( tagFamily );
+ _tagFamilies.add( tagFamily );
List tagsElements = tagshandlerElement.getChildren(
"tags" );
@@ -170,15 +188,13 @@
}
}
- return tagFamilies;
}
- catch( Exception e )
+ catch( Exception ex )
{
- e.printStackTrace();
- throw new ConditionException( e.getMessage() );
+ System.out.println( "URL in question: " + xtagsURL.toString()
);
+ ex.printStackTrace();
}
}
-
/**
* produce option set for tag parameter
*
@@ -343,6 +359,8 @@
{
SAXBuilder builder = new SAXBuilder();
+ _log.debug( "org.xml.sax.parser: " + System.getProperty(
"org.xml.sax.parser" ) );
+ _log.debug( "org.xml.sax.driver: " + System.getProperty(
"org.xml.sax.drover" ) );
_document = builder.build( xml );
}
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel