Update of /cvsroot/xdoclet/xjavadoc/src/xjavadoc
In directory sc8-pr-cvs1:/tmp/cvs-serv20027/src/xjavadoc

Modified Files:
        SourceClass.java XJavaDoc.java 
Log Message:
Patch submitted by Takashi Okamoto for alternate source file encodings

Index: SourceClass.java
===================================================================
RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/SourceClass.java,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -r1.63 -r1.64
*** SourceClass.java    20 Aug 2003 13:56:37 -0000      1.63
--- SourceClass.java    30 Aug 2003 06:23:13 -0000      1.64
***************
*** 82,86 ****
        public SourceClass( XJavaDoc xJavaDoc, File sourceFile, XTagFactory tagFactory 
)
        {
!               this( xJavaDoc, new XJavadocFile( sourceFile ), false, tagFactory );
        }
  
--- 82,86 ----
        public SourceClass( XJavaDoc xJavaDoc, File sourceFile, XTagFactory tagFactory 
)
        {
!               this( xJavaDoc, new XJavadocFile( sourceFile ), false, tagFactory, 
null );
        }
  
***************
*** 92,96 ****
        public SourceClass( XJavaDoc xJavaDoc, Reader sourceFile, XTagFactory 
tagFactory )
        {
!               this( xJavaDoc, new ReaderFile( sourceFile ), false, tagFactory );
        }
  
--- 92,96 ----
        public SourceClass( XJavaDoc xJavaDoc, Reader sourceFile, XTagFactory 
tagFactory )
        {
!               this( xJavaDoc, new ReaderFile( sourceFile ), false, tagFactory, null);
        }
  
***************
*** 101,105 ****
        public SourceClass( XJavaDoc xJavaDoc, File sourceFile, boolean useNodeParser, 
XTagFactory tagFactory )
        {
!               this( xJavaDoc, new XJavadocFile( sourceFile ), useNodeParser, 
tagFactory );
        }
  
--- 101,105 ----
        public SourceClass( XJavaDoc xJavaDoc, File sourceFile, boolean useNodeParser, 
XTagFactory tagFactory )
        {
!               this( xJavaDoc, new XJavadocFile( sourceFile ), useNodeParser, 
tagFactory ,null );
        }
  
***************
*** 110,114 ****
         * @param useNodeParser
         */
!       public SourceClass( XJavaDoc xJavaDoc, AbstractFile sourceFile, boolean 
useNodeParser, XTagFactory tagFactory )
        {
                super( xJavaDoc, tagFactory );
--- 110,114 ----
         * @param useNodeParser
         */
!       public SourceClass( XJavaDoc xJavaDoc, AbstractFile sourceFile, boolean 
useNodeParser, XTagFactory tagFactory ,String encoding)
        {
                super( xJavaDoc, tagFactory );
***************
*** 121,125 ****
                try
                {
!                       _in = sourceFile.getReader();
                        parse( useNodeParser );
                }
--- 121,125 ----
                try
                {
!                       _in = sourceFile.getReader(encoding);
                        parse( useNodeParser );
                }
***************
*** 127,131 ****
--- 127,138 ----
                {
                        // That's tough. Shouldn't happen
+                       if(encoding==null)
+                       {
                        throw new IllegalStateException( "Couldn't find " + sourceFile 
);
+               }
+                       else
+                       {
+                               throw new IllegalStateException( "Invalid Encoding 
'"+encoding+"' or couldn't find '" + sourceFile +"'");
+                       }
                }
  

Index: XJavaDoc.java
===================================================================
RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/XJavaDoc.java,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -r1.78 -r1.79
*** XJavaDoc.java       9 Jul 2003 12:33:05 -0000       1.78
--- XJavaDoc.java       30 Aug 2003 06:23:14 -0000      1.79
***************
*** 55,58 ****
--- 55,59 ----
        private final Map  _packages = new HashMap();
        private final Set  _sourceSets = new HashSet();
+ 
        /**
         * This map contains all the classes that were passed in the source sets,
***************
*** 103,106 ****
--- 104,113 ----
        private boolean    _useNodeParser = false;
  
+       /** charset for source file */
+       private String _encoding = null;
+       
+       /** charset for generated file */
+       private String _docEncoding = null;
+       
        public XJavaDoc()
        {
***************
*** 918,922 ****
                }
  
!               SourceClass sourceClass = new SourceClass( this, sourceFile, 
_useNodeParser, _tagFactory );
  
                // now that the entire file is parsed, validate the tags.
--- 925,929 ----
                }
  
!               SourceClass sourceClass = new SourceClass( this, sourceFile, 
_useNodeParser, _tagFactory ,_encoding);
  
                // now that the entire file is parsed, validate the tags.
***************
*** 967,970 ****
--- 974,1009 ----
                        _level = level;
                }
+       }
+ 
+       /**
+        * Getter for source file charset.
+        * @return encoding
+        */
+       public String getEncoding() {
+               return _encoding;
+       }
+ 
+       /**
+        * Setter for source file charset.
+        * @param string encoding
+        */
+       public void setEncoding(String encoding) {
+               _encoding = encoding;
+       }
+ 
+       /**
+        * Getter for generated file charset.
+        * @return encoding
+        */
+       public String getDocEncoding() {
+               return _docEncoding;
+       }
+ 
+       /**
+        * Setter for generated file charset.
+        * @param string encoding 
+        */
+       public void setDocEncoding(String docencoding) {
+               _docEncoding = docencoding;
        }
  



-------------------------------------------------------
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

Reply via email to