CVS: xdoclet/modules/jdo/src/xdoclet/modules/jdo JdoTagsHandler.java,1.13,1.14

Marco Schulze <[email protected]>
Newsgroups gmane.comp.java.xdoclet.devel
Message-ID <[email protected]>
Update of /cvsroot/xdoclet/xdoclet/modules/jdo/src/xdoclet/modules/jdo
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5871/modules/jdo/src/xdoclet/modules/jdo

Modified Files:
	JdoTagsHandler.java 
Log Message:
- xtags.xml: Replaced all ' by &apos; and all " by &quot;
- Tag 'jdo.fetch-group': Attributes 'field-names' and 'fetch-group-names' are deprecated now and replaced by 'fields' and 'fetch-groups'.

Index: JdoTagsHandler.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/modules/jdo/src/xdoclet/modules/jdo/JdoTagsHandler.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** JdoTagsHandler.java	18 Sep 2005 23:37:51 -0000	1.13
--- JdoTagsHandler.java	19 Sep 2005 17:19:57 -0000	1.14
***************
*** 9,12 ****
--- 9,15 ----
  import java.util.Iterator;
  import java.util.Properties;
+ 
+ import org.apache.commons.logging.Log;
+ 
  import xjavadoc.XClass;
  import xjavadoc.XDoc;
***************
*** 16,19 ****
--- 19,23 ----
  import xdoclet.XDocletException;
  import xdoclet.XDocletTagSupport;
+ import xdoclet.util.LogUtil;
  
  /**
***************
*** 232,254 ****
       * @throws XDocletException
       */
!     public void forAllFetchGroupFieldNames(String template, Properties attributes) throws XDocletException
      {
          if (!"jdo.fetch-group".equals(getCurrentClassTag().getName()))
              throw new IllegalStateException("currentClassTag.name=\"" + getCurrentClassTag().getName() + "\" but must be \"jdo.fetch-group\"!");
  
          String fieldNamesString = getCurrentClassTag().getAttributeValue("field-names");
  
!         if (fieldNamesString == null) {
!             // there is no field-names attribute
              return;
          }
  
!         String[] fieldNames = fieldNamesString.replaceAll(" ", "").split(",");
  
!         for (int i = 0; i < fieldNames.length; ++i) {
!             String fieldNameRaw = fieldNames[i];
  
!             // split fieldNameRaw into fieldName + fetch-depth
!             String[] parts = fieldNameRaw.split("\\[");
              String fieldName = parts[0];
              int fetchDepth;
--- 236,285 ----
       * @throws XDocletException
       */
!     public void forAllFetchGroupFields(String template, Properties attributes) throws XDocletException
      {
+         Log log = null;
+ 
          if (!"jdo.fetch-group".equals(getCurrentClassTag().getName()))
              throw new IllegalStateException("currentClassTag.name=\"" + getCurrentClassTag().getName() + "\" but must be \"jdo.fetch-group\"!");
  
+         String fieldsString = getCurrentClassTag().getAttributeValue("fields");
+ 
+         // field-names is deprecated (but of course, we still process it)
          String fieldNamesString = getCurrentClassTag().getAttributeValue("field-names");
  
!         if (fieldNamesString != null) {
!             if (log == null)
!                 log = LogUtil.getLog(JdoTagsHandler.class, "forAllFetchGroupFields");
! 
!             log.warn("The attribute 'field-names' of the tag '@jdo.fetch-group' is deprecated! Use the attribute 'fields' instead! Class: " + getCurrentClass().getQualifiedName());
!             System.err.println("Warning: The attribute 'field-names' of the tag '@jdo.fetch-group' is deprecated! Use the attribute 'fields' instead! Class: " + getCurrentClass().getQualifiedName());
! 
!             if (fieldsString == null)
!                 fieldsString = fieldNamesString;
!             else
!                 fieldsString += "," + fieldNamesString;
!         }
! 
!         // check for deprecated 'fetch-group-names' and log a deprecation-warning
!         if (getCurrentClassTag().getAttributeValue("fetch-group-names") != null) {
!             if (log == null)
!                 log = LogUtil.getLog(JdoTagsHandler.class, "forAllFetchGroupFields");
! 
!             log.warn("The attribute 'fetch-group-names' of the tag '@jdo.fetch-group' is deprecated! Use the attribute 'fetch-groups' instead! Class: " + getCurrentClass().getQualifiedName());
!             System.err.println("Warning: The attribute 'fetch-group-names' of the tag '@jdo.fetch-group' is deprecated! Use the attribute 'fetch-groups' instead! Class: " + getCurrentClass().getQualifiedName());
!         }
! 
!         if (fieldsString == null) {
!             // there is no fields and no field-names attribute
              return;
          }
  
!         String[] fields = fieldsString.replaceAll(" ", "").split(",");
  
!         for (int i = 0; i < fields.length; ++i) {
!             String fieldRaw = fields[i];
  
!             // split fieldRaw into fieldName + fetch-depth
!             String[] parts = fieldRaw.split("\\[");
              String fieldName = parts[0];
              int fetchDepth;



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.