Java Doc for FixCRLF.java in  » Build » ANT » org » apache » tools » ant » taskdefs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant.taskdefs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.taskdefs.MatchingTask
   org.apache.tools.ant.taskdefs.FixCRLF

FixCRLF
public class FixCRLF extends MatchingTask implements ChainableReader(Code)
Converts text source files to local OS formatting conventions, as well as repair text files damaged by misconfigured or misguided editors or file transfer programs.

This task can take the following arguments:

  • srcdir
  • destdir
  • include
  • exclude
  • cr
  • eol
  • tab
  • eof
  • encoding
  • targetencoding
Of these arguments, only sourcedir is required.

When this task executes, it will scan the srcdir based on the include and exclude properties.

This version generalises the handling of EOL characters, and allows for CR-only line endings (the standard on Mac systems prior to OS X). Tab handling has also been generalised to accommodate any tabwidth from 2 to 80, inclusive. Importantly, it will leave untouched any literal TAB characters embedded within string or character constants.

Warning: do not run on binary files. Caution: run with care on carefully formatted files. This may sound obvious, but if you don't specify asis, presume that your files are going to be modified. If "tabs" is "add" or "remove", whitespace characters may be added or removed as necessary. Similarly, for CR's - in fact "eol"="crlf" or cr="add" can result in cr characters being removed in one special case accommodated, i.e., CRCRLF is regarded as a single EOL to handle cases where other programs have converted CRLF into CRCRLF.
since:
   Ant 1.1


Inner Class :protected class OneLiner implements Enumeration
Inner Class :public static class AddAsisRemove extends EnumeratedAttribute
Inner Class :public static class CrLf extends EnumeratedAttribute

Field Summary
final public static  StringERROR_FILE_AND_SRCDIR
    


Method Summary
final public  Readerchain(Reader rdr)
     Chain this task as a reader.
Parameters:
  rdr - Reader to chain.
public  voidexecute()
     Executes the task.
public  voidsetCr(AddAsisRemove attr)
     Specify how carriage return (CR) characters are to be handled.
public  voidsetDestdir(File destDir)
     Set the destination where the fixed files should be placed.
public  voidsetEncoding(String encoding)
     Specifies the encoding Ant expects the files to be in--defaults to the platforms default encoding.
public  voidsetEof(AddAsisRemove attr)
     Specify how DOS EOF (control-z) characters are to be handled.
public  voidsetEol(CrLf attr)
     Specify how EndOfLine characters are to be handled.
public  voidsetFile(File file)
     Set a single file to convert.
public  voidsetFixlast(boolean fixlast)
     Specify whether a missing EOL will be added to the final line of a file.
public  voidsetJavafiles(boolean javafiles)
     Set to true if modifying Java source files.
public  voidsetOutputEncoding(String outputEncoding)
     Specifies the encoding that the files are to be written in--same as input encoding by default.
public  voidsetPreserveLastModified(boolean preserve)
     Set whether to preserve the last modified time as the original files.
public  voidsetSrcdir(File srcDir)
     Set the source dir to find the source text files.
public  voidsetTab(AddAsisRemove attr)
     Specify how tab characters are to be handled.
public  voidsetTablength(int tlength)
     Specify tab length in characters.

Field Detail
ERROR_FILE_AND_SRCDIR
final public static String ERROR_FILE_AND_SRCDIR(Code)
error string for using srcdir and file





Method Detail
chain
final public Reader chain(Reader rdr)(Code)
Chain this task as a reader.
Parameters:
  rdr - Reader to chain. a Reader.
since:
   Ant 1.7?



execute
public void execute() throws BuildException(Code)
Executes the task.
throws:
  BuildException - on error.



setCr
public void setCr(AddAsisRemove attr)(Code)
Specify how carriage return (CR) characters are to be handled.
Parameters:
  attr - valid values:
  • add: ensure that there is a CR before every LF
  • asis: leave CR characters alone
  • remove: remove all CR characters
FixCRLF.setEol setEol



setDestdir
public void setDestdir(File destDir)(Code)
Set the destination where the fixed files should be placed. Default is to replace the original file.
Parameters:
  destDir - the destination directory.



setEncoding
public void setEncoding(String encoding)(Code)
Specifies the encoding Ant expects the files to be in--defaults to the platforms default encoding.
Parameters:
  encoding - String encoding name.



setEof
public void setEof(AddAsisRemove attr)(Code)
Specify how DOS EOF (control-z) characters are to be handled.
Parameters:
  attr - valid values:
  • add: ensure that there is an eof at the end of the file
  • asis: leave eof characters alone
  • remove: remove any eof character found at the end



setEol
public void setEol(CrLf attr)(Code)
Specify how EndOfLine characters are to be handled.
Parameters:
  attr - valid values:
  • asis: leave line endings alone
  • cr: convert line endings to CR
  • lf: convert line endings to LF
  • crlf: convert line endings to CRLF



setFile
public void setFile(File file)(Code)
Set a single file to convert.
since:
   Ant 1.6.3
Parameters:
  file - the file to convert.



setFixlast
public void setFixlast(boolean fixlast)(Code)
Specify whether a missing EOL will be added to the final line of a file.
Parameters:
  fixlast - whether to fix the last line.



setJavafiles
public void setJavafiles(boolean javafiles)(Code)
Set to true if modifying Java source files.
Parameters:
  javafiles - whether modifying Java files.



setOutputEncoding
public void setOutputEncoding(String outputEncoding)(Code)
Specifies the encoding that the files are to be written in--same as input encoding by default.
Parameters:
  outputEncoding - String outputEncoding name.



setPreserveLastModified
public void setPreserveLastModified(boolean preserve)(Code)
Set whether to preserve the last modified time as the original files.
Parameters:
  preserve - true if timestamps should be preserved.
since:
   Ant 1.6.3



setSrcdir
public void setSrcdir(File srcDir)(Code)
Set the source dir to find the source text files.
Parameters:
  srcDir - the source directory.



setTab
public void setTab(AddAsisRemove attr)(Code)
Specify how tab characters are to be handled.
Parameters:
  attr - valid values:
  • add: convert sequences of spaces which span a tab stop to tabs
  • asis: leave tab and space characters alone
  • remove: convert tabs to spaces



setTablength
public void setTablength(int tlength) throws BuildException(Code)
Specify tab length in characters.
Parameters:
  tlength - specify the length of tab in spaces.
throws:
  BuildException - on error.



Fields inherited from org.apache.tools.ant.taskdefs.MatchingTask
protected FileSet fileset(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.taskdefs.MatchingTask
public void XsetIgnore(String ignoreString)(Code)(Java Doc)
public void XsetItems(String itemString)(Code)(Java Doc)
public void add(FileSelector selector)(Code)(Java Doc)
public void addAnd(AndSelector selector)(Code)(Java Doc)
public void addContains(ContainsSelector selector)(Code)(Java Doc)
public void addContainsRegexp(ContainsRegexpSelector selector)(Code)(Java Doc)
public void addCustom(ExtendSelector selector)(Code)(Java Doc)
public void addDate(DateSelector selector)(Code)(Java Doc)
public void addDepend(DependSelector selector)(Code)(Java Doc)
public void addDepth(DepthSelector selector)(Code)(Java Doc)
public void addDifferent(DifferentSelector selector)(Code)(Java Doc)
public void addFilename(FilenameSelector selector)(Code)(Java Doc)
public void addMajority(MajoritySelector selector)(Code)(Java Doc)
public void addModified(ModifiedSelector selector)(Code)(Java Doc)
public void addNone(NoneSelector selector)(Code)(Java Doc)
public void addNot(NotSelector selector)(Code)(Java Doc)
public void addOr(OrSelector selector)(Code)(Java Doc)
public void addPresent(PresentSelector selector)(Code)(Java Doc)
public void addSelector(SelectSelector selector)(Code)(Java Doc)
public void addSize(SizeSelector selector)(Code)(Java Doc)
public void addType(TypeSelector selector)(Code)(Java Doc)
public void appendSelector(FileSelector selector)(Code)(Java Doc)
public PatternSet.NameEntry createExclude()(Code)(Java Doc)
public PatternSet.NameEntry createExcludesFile()(Code)(Java Doc)
public PatternSet.NameEntry createInclude()(Code)(Java Doc)
public PatternSet.NameEntry createIncludesFile()(Code)(Java Doc)
public PatternSet createPatternSet()(Code)(Java Doc)
protected DirectoryScanner getDirectoryScanner(File baseDir)(Code)(Java Doc)
final protected FileSet getImplicitFileSet()(Code)(Java Doc)
public FileSelector[] getSelectors(Project p)(Code)(Java Doc)
public boolean hasSelectors()(Code)(Java Doc)
public int selectorCount()(Code)(Java Doc)
public Enumeration selectorElements()(Code)(Java Doc)
public void setCaseSensitive(boolean isCaseSensitive)(Code)(Java Doc)
public void setDefaultexcludes(boolean useDefaultExcludes)(Code)(Java Doc)
public void setExcludes(String excludes)(Code)(Java Doc)
public void setExcludesfile(File excludesfile)(Code)(Java Doc)
public void setFollowSymlinks(boolean followSymlinks)(Code)(Java Doc)
public void setIncludes(String includes)(Code)(Java Doc)
public void setIncludesfile(File includesfile)(Code)(Java Doc)
public void setProject(Project project)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.