Source Code Cross Referenced for PropertiesToken.java in  » Template-Engine » ostermillerutils » com » Ostermiller » util » 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 » Template Engine » ostermillerutils » com.Ostermiller.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2002-2007 Stephen Ostermiller
003:         * http://ostermiller.org/contact.pl?regarding=Java+Utilities
004:         *
005:         * This program is free software; you can redistribute it and/or modify
006:         * it under the terms of the GNU General Public License as published by
007:         * the Free Software Foundation; either version 2 of the License, or
008:         * (at your option) any later version.
009:         *
010:         * This program is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013:         * GNU General Public License for more details.
014:         *
015:         * See COPYING.TXT for details.
016:         */
017:        package com.Ostermiller.util;
018:
019:        /**
020:         * A PropertiesToken is a token that is returned by a lexer that is lexing a Java
021:         * Properties file.  It has several attributes describing the token:
022:         * The type of token, the text of the token, the line number on which it
023:         * occurred, the number of characters into the input at which it started, and
024:         * similarly, the number of characters into the input at which it ended. <br>
025:         *
026:         * @author Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
027:         * @since ostermillerutils 1.00.00
028:         */
029:        class PropertiesToken {
030:
031:            /** comment -- 0 */
032:            public final static int COMMENT = 0x0;
033:
034:            /** end of line white space -- 1 */
035:            public final static int END_LINE_WHITE_SPACE = 0x1;
036:
037:            /** white space -- 2 */
038:            public final static int WHITE_SPACE = 0x2;
039:
040:            /** separator -- 3 */
041:            public final static int SEPARATOR = 0x3;
042:
043:            /** continue line -- 4 */
044:            public final static int CONTINUE_LINE = 0x4;
045:
046:            /** name -- 5 */
047:            public final static int NAME = 0x5;
048:
049:            /** value -- 6 */
050:            public final static int VALUE = 0x6;
051:
052:            private int ID;
053:            private String contents;
054:
055:            /**
056:             * Create a new token.
057:             * The constructor is typically called by the lexer
058:             *
059:             * @param ID the id number of the token
060:             * @param contents A string representing the text of the token
061:             *
062:             * @since ostermillerutils 1.00.00
063:             */
064:            public PropertiesToken(int ID, String contents) {
065:                this .ID = ID;
066:                this .contents = contents;
067:            }
068:
069:            /**
070:             * get the ID number of this token
071:             *
072:             * @return the id number of the token
073:             *
074:             * @since ostermillerutils 1.00.00
075:             */
076:            public int getID() {
077:                return ID;
078:            }
079:
080:            /**
081:             * get the contents of this token
082:             *
083:             * @return A string representing the text of the token
084:             *
085:             * @since ostermillerutils 1.00.00
086:             */
087:            public String getContents() {
088:                return (contents);
089:            }
090:
091:            /**
092:             * String representation appropriate for debugging.
093:             *
094:             * @return String representation
095:             *
096:             * @since ostermillerutils 1.00.00
097:             */
098:            @Override
099:            public String toString() {
100:                String idString = "";
101:                switch (ID) {
102:                case COMMENT:
103:                    idString = "COMMENT";
104:                    break;
105:                case END_LINE_WHITE_SPACE:
106:                    idString = "END_LINE_WHITE_SPACE";
107:                    break;
108:                case WHITE_SPACE:
109:                    idString = "WHITE_SPACE";
110:                    break;
111:                case SEPARATOR:
112:                    idString = "SEPARATOR";
113:                    break;
114:                case CONTINUE_LINE:
115:                    idString = "CONTINUE_LINE";
116:                    break;
117:                case NAME:
118:                    idString = "NAME";
119:                    break;
120:                case VALUE:
121:                    idString = "VALUE";
122:                    break;
123:                }
124:                idString = StringHelper.postpad(idString, 21);
125:                return idString + '"' + contents + '"';
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.