CVS: xdoclet/modules/jdo/src/xdoclet/modules/jdo JdoXmlMetadataSubTask.java,1.17,1.18 JdoTagsHandler.java,1.14,1.15

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-serv29696/modules/jdo/src/xdoclet/modules/jdo

Modified Files:
	JdoXmlMetadataSubTask.java JdoTagsHandler.java 
Log Message:
adapted xdoclet-jdo to some changes of the jdo_2_0.dtd

Index: JdoXmlMetadataSubTask.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/modules/jdo/src/xdoclet/modules/jdo/JdoXmlMetadataSubTask.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** JdoXmlMetadataSubTask.java	18 Sep 2005 23:37:51 -0000	1.17
--- JdoXmlMetadataSubTask.java	27 Feb 2006 19:25:27 -0000	1.18
***************
*** 61,69 ****
      private String  project = "metadata";
  
- //    /**
- //     * @see   #setFetchDepth(int)
- //     */
- //    private int     fetchDepth = -1;
- 
      /**
       * Describe what the WebXmlSubTask constructor does
--- 61,64 ----
***************
*** 84,95 ****
      }
  
- //    /**
- //     * @return   Returns the fetch-depth as set by {@link #setFetchDepth(int)} or -1 if nothing was set.
- //     */
- //    public int getFetchDepth()
- //    {
- //        return fetchDepth;
- //    }
- 
      public void setProject(String project)
      {
--- 79,82 ----
***************
*** 102,123 ****
      }
  
- //    /**
- //     * The JDO spec defines that a fetch-depth of 1 shall be used if a field has no fetch-depth declared. In case you
- //     * don't like this default, you must tag every field with a different fetch-depth. This is an annoying work if you
- //     * want to have the same for the majority of your fields. Hence, you have the possibility to declare the <code>fetchDepth</code>
- //     * attribute for the <code>jdometadata</code> subtask. This will cause every field to be tagged with this default,
- //     * if the field doesn't have a fetch-depth declared. If the field has a fetch-depth, this one is used.
- //     *
- //     * @param fetchDepth  Either -1 to indicate that no default-fetch-depth should be set, or 0 for infinite depth, or a
- //     *      positive number indicating how many levels the detaching shall dive into the object-graph.
- //     */
- //    public void setFetchDepth(int fetchDepth)
- //    {
- //        if (fetchDepth < -1)
- //            throw new IllegalArgumentException("fetchDepth=" + fetchDepth + " is illegal! Must be -1 to deactivate the default-fetch-depth or a number >= 0!");
- //
- //        this.fetchDepth = fetchDepth;
- //    }
- 
      /**
       * Called to validate configuration parameters.
--- 89,92 ----

Index: JdoTagsHandler.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/modules/jdo/src/xdoclet/modules/jdo/JdoTagsHandler.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** JdoTagsHandler.java	19 Sep 2005 17:19:57 -0000	1.14
--- JdoTagsHandler.java	27 Feb 2006 19:25:27 -0000	1.15
***************
*** 34,52 ****
      private VendorExtension _currentExtension;
  
- //    /**
- //     * @see   #cacheFieldsInFetchGroups
- //     */
- //    private XClass  cacheFieldsInFetchGroupsClass = null;
- //    /**
- //     * This Set stores all fields that are declared in the current class (cached in {@link
- //     * #cacheFieldsInFetchGroupsClass}) to be included in a fetch-group. If a field is in no fetch-group, it is not
- //     * contained in this Set. This Set is null if {@link #ifCurrentFieldIsInFetchGroup(String, Properties)} has not yet
- //     * been called. If {@link #cacheFieldsInFetchGroupsClass} specifies a class that is different from {@link
- //     * XDocletTagSupport#getCurrentClass()} then this Set needs to be recreated.
- //     */
- //    private Set     cacheFieldsInFetchGroups = null;
- 
      private String  currentFetchGroupFieldName = null;
!     private int     currentFetchGroupFieldFetchDepth = -1;
  
      /**
--- 34,39 ----
      private VendorExtension _currentExtension;
  
      private String  currentFetchGroupFieldName = null;
!     private int     currentFetchGroupFieldRecursionDepth = -1;
  
      /**
***************
*** 207,224 ****
      }
  
!     public String currentFetchGroupFieldFetchDepth()
      {
          if (currentFetchGroupFieldName == null)
!             throw new IllegalStateException("You cannot access the currentFetchGroupFieldFetchDepth outside of the forAllFetchGroupFieldNames loop!");
  
!         return Integer.toString(currentFetchGroupFieldFetchDepth);
      }
  
!     public void ifCurrentFetchGroupFieldHasFetchDepth(String template, Properties attributes) throws XDocletException
      {
          if (currentFetchGroupFieldName == null)
!             throw new IllegalStateException("You cannot use ifCurrentFetchGroupFieldHasFetchDepth outside of the forAllFetchGroupFieldNames loop!");
  
!         if (currentFetchGroupFieldFetchDepth >= 0)
              generate(template);
      }
--- 194,211 ----
      }
  
!     public String currentFetchGroupFieldRecursionDepth()
      {
          if (currentFetchGroupFieldName == null)
!             throw new IllegalStateException("You cannot access the currentFetchGroupFieldRecursionDepth outside of the forAllFetchGroupFieldNames loop!");
  
!         return Integer.toString(currentFetchGroupFieldRecursionDepth);
      }
  
!     public void ifCurrentFetchGroupFieldHasRecursionDepth(String template, Properties attributes) throws XDocletException
      {
          if (currentFetchGroupFieldName == null)
!             throw new IllegalStateException("You cannot use ifCurrentFetchGroupFieldHasRecursionDepth outside of the forAllFetchGroupFieldNames loop!");
  
!         if (currentFetchGroupFieldRecursionDepth >= 0)
              generate(template);
      }
***************
*** 226,230 ****
      /**
       * This is used to iterate the comma-separated list of fields within a fetch-group (there must be a current
!      * fetch-group!). Each field may optionally be followed by "[fetch-depth]". <p>
       *
       * Example: <pre>
--- 213,217 ----
      /**
       * This is used to iterate the comma-separated list of fields within a fetch-group (there must be a current
!      * recursion-group!). Each field may optionally be followed by "[recursion-depth]". <p>
       *
       * Example: <pre>
***************
*** 280,300 ****
              String fieldRaw = fields[i];
  
!             // split fieldRaw into fieldName + fetch-depth
              String[] parts = fieldRaw.split("\\[");
              String fieldName = parts[0];
!             int fetchDepth;
  
              if (parts.length == 1) {
!                 // there is no fetch-depth
!                 fetchDepth = -1;
              }
              else if (parts.length == 2) {
!                 String fetchDepthStr = parts[1];
  
!                 if (!fetchDepthStr.endsWith("]"))
                      throw new XDocletException("Attribute field-names of fetch-group \"" + getCurrentClassTag().getAttributeValue("name") + "\" is not formatted correctly! One of the fields has an open [ and misses the closing ]!");
  
                  try {
!                     fetchDepth = Integer.parseInt(fetchDepthStr.substring(0, fetchDepthStr.length() - 1));
                  }
                  catch (NumberFormatException x) {
--- 267,287 ----
              String fieldRaw = fields[i];
  
!             // split fieldRaw into fieldName + recursion-depth
              String[] parts = fieldRaw.split("\\[");
              String fieldName = parts[0];
!             int recursionDepth;
  
              if (parts.length == 1) {
!                 // there is no recursion-depth
!                 recursionDepth = -1;
              }
              else if (parts.length == 2) {
!                 String recursionDepthStr = parts[1];
  
!                 if (!recursionDepthStr.endsWith("]"))
                      throw new XDocletException("Attribute field-names of fetch-group \"" + getCurrentClassTag().getAttributeValue("name") + "\" is not formatted correctly! One of the fields has an open [ and misses the closing ]!");
  
                  try {
!                     recursionDepth = Integer.parseInt(recursionDepthStr.substring(0, recursionDepthStr.length() - 1));
                  }
                  catch (NumberFormatException x) {
***************
*** 306,314 ****
  
              currentFetchGroupFieldName = fieldName;
!             currentFetchGroupFieldFetchDepth = fetchDepth;
              generate(template);
          }
          currentFetchGroupFieldName = null;
!         currentFetchGroupFieldFetchDepth = -1;
      }
  
--- 293,301 ----
  
              currentFetchGroupFieldName = fieldName;
!             currentFetchGroupFieldRecursionDepth = recursionDepth;
              generate(template);
          }
          currentFetchGroupFieldName = null;
!         currentFetchGroupFieldRecursionDepth = -1;
      }
  



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
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.