Source Code Cross Referenced for CommonFunctionListGetValueTag.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:
012:        //project specific classes
013:        import org.jfolder.common.SelfArgumentlessConstructor;
014:        import org.jfolder.common.StandardDataTypes;
015:        import org.jfolder.common.UnexpectedSystemException;
016:        import org.jfolder.common.function.BaseCommonFunctionCompatibilityTag;
017:        import org.jfolder.common.function.WebPageTagInstanceViewContext;
018:        import org.jfolder.common.function.WebPageTagInstanceViewContextInfo;
019:        import org.jfolder.common.tagging.AppraiseConceptTagContext;
020:        import org.jfolder.common.tagging.ConceptTag;
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.StaticConceptTagConstraintContext;
034:        import org.jfolder.common.tagging.StudioConceptTagCreParInfoContext;
035:        import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
036:        import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
037:        import org.jfolder.common.tagging.ValueAndClassForConceptTag;
038:        import org.jfolder.common.utils.misc.CommonExpressions;
039:        import org.jfolder.common.utils.misc.MiscHelper;
040:
041:        //other classes
042:
043:        public class CommonFunctionListGetValueTag extends
044:                BaseCommonFunctionCompatibilityTag implements 
045:                SelfArgumentlessConstructor {
046:
047:            //characteristics
048:            private ConceptTagCharacteristic listCtchar = null;
049:            private ConceptTagCharacteristic indexCtchar = null;
050:            private ConceptTagCharacteristic castToCtchar = null;
051:
052:            //
053:            //list details
054:            private final static String LIST_CTCON = "list";
055:            private final static String LIST_TITLE = "List";
056:            private final static String LIST_SHORT_DESCRIPTION = "List";
057:            //
058:            //index details
059:            private final static String INDEX_CTCON = "index";
060:            private final static String INDEX_TITLE = "Index";
061:            private final static String INDEX_SHORT_DESCRIPTION = "Index";
062:            //
063:            //cast-to details
064:            private final static String CAST_TO_CTCON = "cast-to";
065:
066:            public void initialize(InitializeConceptTagContext inIctc) {
067:
068:                //
069:                ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
070:                        .newInstance(inIctc);
071:
072:                //constrain "list"
073:                ConceptTagConstraint listCtcon = ConceptTagConstraint
074:                        .newInstance(LIST_CTCON, rootCtconh);
075:                //
076:                listCtcon.setTitle(LIST_TITLE);
077:                listCtcon.setShortDescription(LIST_SHORT_DESCRIPTION);
078:                //
079:                //
080:                listCtcon.setMinimumLength(1);
081:                listCtcon.setMaximumLength(1);
082:                //
083:                DynamicConceptTagConstraintContext listDctcc = DynamicConceptTagConstraintContext
084:                        .newInstance(listCtcon);
085:                listDctcc.getValidator().allowReturnOfOnlyList();
086:                listDctcc.getValidator().filterDirectChildOfRootAndHtml();
087:                //
088:
089:                //constrain "index"
090:                ConceptTagConstraint indexCtcon = ConceptTagConstraint
091:                        .newInstance(INDEX_CTCON, rootCtconh);
092:                //
093:                indexCtcon.setTitle(INDEX_TITLE);
094:                indexCtcon.setShortDescription(INDEX_SHORT_DESCRIPTION);
095:                //
096:                //
097:                indexCtcon.setMinimumLength(1);
098:                indexCtcon.setMaximumLength(1);
099:                //
100:                DynamicConceptTagConstraintContext indexDctcc = DynamicConceptTagConstraintContext
101:                        .newInstance(indexCtcon);
102:                indexDctcc.getValidator().allowReturnOfOnlyDecimal();
103:                indexDctcc.getValidator().filterDirectChildOfRootAndHtml();
104:                //
105:                StaticConceptTagConstraintContext indexSctcc = StaticConceptTagConstraintContext
106:                        .newInstance(indexCtcon);
107:                indexSctcc.setRegularExpression(
108:                        CommonExpressions.NON_NEGATIVE_INTEGER,
109:                        "Value must be non-negative integer");
110:                //
111:                //
112:
113:                //
114:                //constrain "cast-to"
115:                ConceptTagConstraint castToCtcon = ConceptTagConstraint
116:                        .newInstance(CAST_TO_CTCON, rootCtconh);
117:                ConceptTagHelper.formatConcreteVariableType(castToCtcon, true);
118:
119:                //
120:                ConceptTagFlagsHelper
121:                        .pushNonIterativeCommonFunctionDepth(inIctc);
122:                inIctc.initialize();
123:                ConceptTagFlagsHelper
124:                        .popNonIterativeCommonFunctionDepth(inIctc);
125:
126:                //initialize characteristics
127:                this .listCtchar = listCtcon.getCharacteristic();
128:                this .indexCtchar = indexCtcon.getCharacteristic();
129:                this .castToCtchar = castToCtcon.getCharacteristic();
130:            }
131:
132:            public void appraise(AppraiseConceptTagContext inActc) {
133:
134:                if (inActc instanceof  StudioConceptTagInstanceInfoContext) {
135:
136:                    StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inActc;
137:
138:                    //
139:                    sctiic.setInstanceTitle("Get List Value");
140:                    sctiic.setInstanceDescription("Get List Value");
141:                } else if (inActc instanceof  StudioConceptTagTypeInfoContext) {
142:
143:                    StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inActc;
144:
145:                    scttic.setTypeTitle("Get List Value");
146:                    scttic.setTypeDescription("Get List Value");
147:                } else if (inActc instanceof  WebPageTagInstanceViewContext) {
148:
149:                    WebPageTagInstanceViewContext wptivc = (WebPageTagInstanceViewContext) inActc;
150:
151:                    WebPageTagInstanceViewContextInfo info = wptivc
152:                            .getInfoAsNonHtml();
153:
154:                    //
155:                    //
156:                    WebPageTagInstanceViewContextInfo indexInfo = info
157:                            .createNonHtmlInfo();
158:                    indexInfo.setNonHtmlContent("Get Value At Index (");
159:                    WebPageTagInstanceViewContext.displayView(this .indexCtchar,
160:                            indexInfo, wptivc, "???");
161:                    //
162:                    //
163:                    WebPageTagInstanceViewContextInfo fromInfo = info
164:                            .createNonHtmlInfo();
165:                    fromInfo.setNonHtmlContent(") From (", ")");
166:                    WebPageTagInstanceViewContext.displayView(this .listCtchar,
167:                            fromInfo, wptivc, "???");
168:                    //
169:                    //
170:                    WebPageTagInstanceViewContextInfo castToInfo = info
171:                            .createNonHtmlInfo();
172:                    castToInfo.setNonHtmlContent(" As (", ")");
173:                    WebPageTagInstanceViewContext.displayView(
174:                            this .castToCtchar, castToInfo, wptivc, "???");
175:                    //fromInfo.setEndContent(")");
176:                } else if (inActc instanceof  SelectionCriteriaForReturnableConceptTag) {
177:
178:                    SelectionCriteriaForReturnableConceptTag scfrct = (SelectionCriteriaForReturnableConceptTag) inActc;
179:
180:                    scfrct.canReturnAnythingExceptNothing();
181:                    scfrct.declareFormatAsPlain();
182:                } else if (inActc instanceof  StudioConceptTagCreParInfoContext) {
183:
184:                    StudioConceptTagCreParInfoContext scpc = (StudioConceptTagCreParInfoContext) inActc;
185:                }
186:            }
187:
188:            public void determineValueAndClass(
189:                    DetermineValueAndClassConceptTagContext inDvacctc) {
190:
191:                try {
192:                    ValueAndClassForConceptTag vacfct = null;
193:
194:                    ValueAndClassForConceptTag listVacfct = this .listCtchar
195:                            .getDetermineValueAndClass(0, inDvacctc);
196:
197:                    Object index = null;
198:                    if (this .indexCtchar.isStatic(0, inDvacctc)) {
199:                        //
200:                        index = StandardDataTypes
201:                                .getDecimalInstance(this .indexCtchar
202:                                        .getValueAsString(0, inDvacctc));
203:                    } else {
204:                        ValueAndClassForConceptTag indexVacfct = this .indexCtchar
205:                                .getDetermineValueAndClass(0, inDvacctc);
206:                        //
207:                        index = indexVacfct.getValue();
208:                    }
209:                    //BigDecimal bd = StandardDataTypes.getListLength(
210:                    //    listVacfct.getValue());
211:
212:                    Object o = StandardDataTypes.getListValue(listVacfct
213:                            .getValue(), index);
214:                    vacfct = ((ValueAndClassForConceptTag) o);
215:
216:                    //vacfct = ValueAndClassForConceptTag.newDecimal(bd);
217:
218:                    inDvacctc.setDetermineValueAndClass(vacfct);
219:                } catch (DetermineValueAndClassConceptTagException dvaccte) {
220:                    inDvacctc.setDetermineException(dvaccte);
221:                }
222:            }
223:
224:            public void determineClass(DetermineClassConceptTagContext inDcctc) {
225:
226:                Class result = StandardDataTypes.getAnyClass();
227:                if (!this .castToCtchar.getParentMessageHolder()
228:                        .isErrorPresent()) {
229:                    result = StandardDataTypes.getActualClass(this .castToCtchar
230:                            .getValueAsString(0, inDcctc));
231:                }
232:
233:                inDcctc.setDetermineClass(result);
234:            }
235:
236:            public Object createUninitializedSelf() {
237:                return new CommonFunctionListGetValueTag();
238:            }
239:
240:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.