Source Code Cross Referenced for AttributeInfo.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » tomcat » util » modeler » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.tomcat.util.modeler 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package org.apache.tomcat.util.modeler;
019:
020:        import java.io.Serializable;
021:
022:        import javax.management.MBeanAttributeInfo;
023:
024:        /**
025:         * <p>Internal configuration information for an <code>Attribute</code>
026:         * descriptor.</p>
027:         *
028:         * @author Craig R. McClanahan
029:         */
030:        public class AttributeInfo extends FeatureInfo implements  Serializable {
031:            static final long serialVersionUID = -2511626862303972143L;
032:
033:            // ----------------------------------------------------- Instance Variables
034:            protected String displayName = null;
035:
036:            // Information about the method to use
037:            protected String getMethod = null;
038:            protected String setMethod = null;
039:            protected boolean readable = true;
040:            protected boolean writeable = true;
041:            protected boolean is = false;
042:
043:            // ------------------------------------------------------------- Properties
044:
045:            /**
046:             * The display name of this attribute.
047:             */
048:            public String getDisplayName() {
049:                return (this .displayName);
050:            }
051:
052:            public void setDisplayName(String displayName) {
053:                this .displayName = displayName;
054:            }
055:
056:            /**
057:             * The name of the property getter method, if non-standard.
058:             */
059:            public String getGetMethod() {
060:                if (getMethod == null)
061:                    getMethod = getMethodName(getName(), true, isIs());
062:                return (this .getMethod);
063:            }
064:
065:            public void setGetMethod(String getMethod) {
066:                this .getMethod = getMethod;
067:            }
068:
069:            /**
070:             * Is this a boolean attribute with an "is" getter?
071:             */
072:            public boolean isIs() {
073:                return (this .is);
074:            }
075:
076:            public void setIs(boolean is) {
077:                this .is = is;
078:            }
079:
080:            /**
081:             * Is this attribute readable by management applications?
082:             */
083:            public boolean isReadable() {
084:                return (this .readable);
085:            }
086:
087:            public void setReadable(boolean readable) {
088:                this .readable = readable;
089:            }
090:
091:            /**
092:             * The name of the property setter method, if non-standard.
093:             */
094:            public String getSetMethod() {
095:                if (setMethod == null)
096:                    setMethod = getMethodName(getName(), false, false);
097:                return (this .setMethod);
098:            }
099:
100:            public void setSetMethod(String setMethod) {
101:                this .setMethod = setMethod;
102:            }
103:
104:            /**
105:             * Is this attribute writeable by management applications?
106:             */
107:            public boolean isWriteable() {
108:                return (this .writeable);
109:            }
110:
111:            public void setWriteable(boolean writeable) {
112:                this .writeable = writeable;
113:            }
114:
115:            // --------------------------------------------------------- Public Methods
116:
117:            /**
118:             * Create and return a <code>ModelMBeanAttributeInfo</code> object that
119:             * corresponds to the attribute described by this instance.
120:             */
121:            MBeanAttributeInfo createAttributeInfo() {
122:                // Return our cached information (if any)
123:                if (info == null) {
124:                    info = new MBeanAttributeInfo(getName(), getType(),
125:                            getDescription(), isReadable(), isWriteable(),
126:                            false);
127:                }
128:                return (MBeanAttributeInfo) info;
129:            }
130:
131:            // -------------------------------------------------------- Private Methods
132:
133:            /**
134:             * Create and return the name of a default property getter or setter
135:             * method, according to the specified values.
136:             *
137:             * @param name Name of the property itself
138:             * @param getter Do we want a get method (versus a set method)?
139:             * @param is If returning a getter, do we want the "is" form?
140:             */
141:            private String getMethodName(String name, boolean getter, boolean is) {
142:
143:                StringBuffer sb = new StringBuffer();
144:                if (getter) {
145:                    if (is)
146:                        sb.append("is");
147:                    else
148:                        sb.append("get");
149:                } else
150:                    sb.append("set");
151:                sb.append(Character.toUpperCase(name.charAt(0)));
152:                sb.append(name.substring(1));
153:                return (sb.toString());
154:
155:            }
156:
157:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.