Source Code Cross Referenced for BugProperty.java in  » Code-Analyzer » findbugs » edu » umd » cs » findbugs » 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 » Code Analyzer » findbugs » edu.umd.cs.findbugs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * FindBugs - Find bugs in Java programs
003:         * Copyright (C) 2003-2005 University of Maryland
004:         * 
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2.1 of the License, or (at your option) any later version.
009:         * 
010:         * This library 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 GNU
013:         * Lesser General Public License for more details.
014:         * 
015:         * You should have received a copy of the GNU Lesser General Public
016:         * License along with this library; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018:         */
019:
020:        package edu.umd.cs.findbugs;
021:
022:        import java.io.IOException;
023:        import java.io.Serializable;
024:
025:        import edu.umd.cs.findbugs.xml.XMLAttributeList;
026:        import edu.umd.cs.findbugs.xml.XMLOutput;
027:        import edu.umd.cs.findbugs.xml.XMLWriteable;
028:
029:        /**
030:         * Name/value metadata pair that may be attached to a BugInstance.
031:         * These are different from BugAnnotations because they are not
032:         * meant to be shown directly to the user.
033:         * 
034:         * @author David Hovemeyer
035:         */
036:        public class BugProperty implements  XMLWriteable, Serializable,
037:                Cloneable {
038:            private static final long serialVersionUID = 1L;
039:
040:            // Constants defining some standard bug properties
041:
042:            /** Boolean property defining whether or not the BugInstance is really a bug. */
043:            public static final String IS_BUG = "isBug";
044:
045:            /** Integer property defining the warning severity (1=least severe, 5=most severe). */
046:            public static final String SEVERITY = "severity";
047:
048:            // Fields
049:            private String name;
050:            private String value;
051:            private BugProperty next;
052:
053:            /**
054:             * Constructor.
055:             * 
056:             * @param name  name of property
057:             * @param value value of property
058:             */
059:            BugProperty(String name, String value) {
060:                this .name = name.intern();
061:                this .value = value;
062:            }
063:
064:            @Override
065:            protected Object clone() {
066:                try {
067:                    return super .clone();
068:                } catch (CloneNotSupportedException e) {
069:                    throw new AssertionError(e);
070:                }
071:            }
072:
073:            /**
074:             * Get name of property.
075:             * 
076:             * @return name of property
077:             */
078:            public String getName() {
079:                return name;
080:            }
081:
082:            /**
083:             * Get value of property.
084:             * 
085:             * @return value of property
086:             */
087:            public String getValue() {
088:                return value;
089:            }
090:
091:            /**
092:             * Get value of property as boolean.
093:             * 
094:             * @return value of property as a boolean
095:             */
096:            public boolean getValueAsBoolean() {
097:                return Boolean.valueOf(getValue()).booleanValue();
098:            }
099:
100:            /**
101:             * Get value of property as an integer.
102:             * 
103:             * @return value of property as integer
104:             * @throws NumberFormatException if the value cannot be parsed as
105:             *         an integer
106:             */
107:            public int getValueAsInt() {
108:                return Integer.parseInt(getValue());
109:            }
110:
111:            /**
112:             * Set value of property.
113:             * 
114:             * @param value
115:             */
116:            public void setValue(String value) {
117:                this .value = value;
118:            }
119:
120:            /**
121:             * Set next property in list.
122:             * 
123:             * @param next next property in list
124:             */
125:            void setNext(BugProperty next) {
126:                this .next = next;
127:            }
128:
129:            /**
130:             * Get next property in list.
131:             * 
132:             * @return next property in list
133:             */
134:            BugProperty getNext() {
135:                return next;
136:            }
137:
138:            /* (non-Javadoc)
139:             * @see edu.umd.cs.findbugs.xml.XMLWriteable#writeXML(edu.umd.cs.findbugs.xml.XMLOutput)
140:             */
141:            public void writeXML(XMLOutput xmlOutput) throws IOException {
142:                xmlOutput.openCloseTag("Property", new XMLAttributeList()
143:                        .addAttribute("name", getName()).addAttribute("value",
144:                                getValue()));
145:            }
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.