Source Code Cross Referenced for CommonFunctionConvStrToDecTag.java in  » Workflow-Engines » JFolder » org » jfolder » common » function » v1 » 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 » Workflow Engines » JFolder » org.jfolder.common.function.v1 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.common.function.v1;
009:
010:        //base classes
011:        import java.math.BigDecimal;
012:
013:        //project specific classes
014:        import org.jfolder.common.SelfArgumentlessConstructor;
015:        import org.jfolder.common.StandardDataTypes;
016:        import org.jfolder.common.UnexpectedSystemException;
017:        import org.jfolder.common.function.BaseCommonFunctionCompatibilityTag;
018:        import org.jfolder.common.function.WebPageTagInstanceViewContext;
019:        import org.jfolder.common.function.WebPageTagInstanceViewContextInfo;
020:        import org.jfolder.common.tagging.AppraiseConceptTagContext;
021:        import org.jfolder.common.tagging.ConceptTagCharacteristic;
022:        import org.jfolder.common.tagging.ConceptTagConstraint;
023:        import org.jfolder.common.tagging.ConceptTagConstraintHolder;
024:        import org.jfolder.common.tagging.ConceptTagFlagsHelper;
025:        import org.jfolder.common.tagging.ConceptTagHelper;
026:        import org.jfolder.common.tagging.DetermineClassConceptTagContext;
027:        import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
028:        import org.jfolder.common.tagging.DetermineValueAndClassConceptTagException;
029:        import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
030:        import org.jfolder.common.tagging.InitializeConceptTagContext;
031:        import org.jfolder.common.tagging.ReturnableConceptTag;
032:        import org.jfolder.common.tagging.SelectionCriteriaForReturnableConceptTag;
033:        import org.jfolder.common.tagging.StudioConceptTagCreParInfoContext;
034:        import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
035:        import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
036:        import org.jfolder.common.tagging.ValueAndClassForConceptTag;
037:
038:        //other classes
039:
040:        public class CommonFunctionConvStrToDecTag extends
041:                BaseCommonFunctionCompatibilityTag implements 
042:                SelfArgumentlessConstructor {
043:
044:            //characteristics
045:            private ConceptTagCharacteristic operandCtchar = null;
046:
047:            //operand details
048:            private final static String OPERAND_CTCON = "operand";
049:            private final static String OPERAND_TITLE = "Operand";
050:            private final static String OPERAND_SHORT_DESCRIPTION = "Value to be converted into a decimal";
051:
052:            public void initialize(InitializeConceptTagContext inIctc) {
053:
054:                //
055:                ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
056:                        .newInstance(inIctc);
057:
058:                //constrain "operand"
059:                ConceptTagConstraint operandCtcon = ConceptTagConstraint
060:                        .newInstance(OPERAND_CTCON, rootCtconh);
061:                operandCtcon.setTitle(OPERAND_TITLE);
062:                operandCtcon.setShortDescription(OPERAND_SHORT_DESCRIPTION);
063:                operandCtcon.setMinimumLength(1);
064:                operandCtcon.setMaximumLength(1);
065:                //
066:                DynamicConceptTagConstraintContext operandDctcc = DynamicConceptTagConstraintContext
067:                        .newInstance(operandCtcon);
068:                operandDctcc.getValidator().allowReturnOfOnlyString();
069:                operandDctcc.getValidator().filterDirectChildOfRootAndHtml();
070:                //
071:                //operandDctcc.addDefaultValue(
072:                //    GetApplicationAttributeWorkflowTemplateTag.class);
073:                //TO DO: should there be a default?
074:                //TO DO: possibly constrain return type here instead of below?
075:
076:                //
077:                ConceptTagFlagsHelper
078:                        .pushNonIterativeCommonFunctionDepth(inIctc);
079:                inIctc.initialize();
080:                ConceptTagFlagsHelper
081:                        .popNonIterativeCommonFunctionDepth(inIctc);
082:                //TO DO: check if casting is acceptable after initialization
083:
084:                //initialize characteristics
085:                this .operandCtchar = operandCtcon.getCharacteristic();
086:
087:            }
088:
089:            public void appraise(AppraiseConceptTagContext inActc) {
090:
091:                if (inActc instanceof  StudioConceptTagInstanceInfoContext) {
092:
093:                    StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inActc;
094:
095:                    sctiic.setInstanceTitle("String To Decimal");
096:                    sctiic
097:                            .setInstanceDescription("Converts String to a Decimal");
098:                } else if (inActc instanceof  StudioConceptTagTypeInfoContext) {
099:
100:                    StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inActc;
101:
102:                    scttic.setTypeTitle("String To Decimal");
103:                    scttic.setTypeDescription("Converts String to a Decimal");
104:                } else if (inActc instanceof  WebPageTagInstanceViewContext) {
105:
106:                    WebPageTagInstanceViewContext wptivc = (WebPageTagInstanceViewContext) inActc;
107:
108:                    WebPageTagInstanceViewContextInfo info = wptivc
109:                            .getInfoAsNonHtml();
110:
111:                    //
112:                    //
113:                    WebPageTagInstanceViewContextInfo operandInfo = info
114:                            .createNonHtmlInfo();
115:                    operandInfo.setNonHtmlContent("ToDecimal(", ")");
116:                    WebPageTagInstanceViewContext.displayView(
117:                            this .operandCtchar, operandInfo, wptivc, "???");
118:                    //operandInfo.setEndContent(")");
119:                } else if (inActc instanceof  SelectionCriteriaForReturnableConceptTag) {
120:
121:                    SelectionCriteriaForReturnableConceptTag scfrct = (SelectionCriteriaForReturnableConceptTag) inActc;
122:
123:                    scfrct.canReturnDecimal();
124:                    scfrct.declareFormatAsPlain();
125:                } else if (inActc instanceof  StudioConceptTagCreParInfoContext) {
126:
127:                    StudioConceptTagCreParInfoContext scpc = (StudioConceptTagCreParInfoContext) inActc;
128:                }
129:            }
130:
131:            public void determineValueAndClass(
132:                    DetermineValueAndClassConceptTagContext inDvacctc) {
133:
134:                try {
135:
136:                    ValueAndClassForConceptTag vacfct = null;
137:
138:                    ValueAndClassForConceptTag operandVac = this .operandCtchar
139:                            .getDetermineValueAndClass(0, inDvacctc);
140:                    BigDecimal result = new BigDecimal((String) operandVac
141:                            .getValue());
142:                    vacfct = ValueAndClassForConceptTag.newDecimal(result);
143:
144:                    inDvacctc.setDetermineValueAndClass(vacfct);
145:                } catch (DetermineValueAndClassConceptTagException dvaccte) {
146:                    inDvacctc.setDetermineException(dvaccte);
147:                } catch (NumberFormatException nfe) {
148:                    inDvacctc.setDetermineException(nfe);
149:                }
150:            }
151:
152:            public void determineClass(DetermineClassConceptTagContext inDcctc) {
153:                inDcctc.setDetermineClass(StandardDataTypes.getDecimalClass());
154:            }
155:
156:            public Object createUninitializedSelf() {
157:                return new CommonFunctionConvStrToDecTag();
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.