Source Code Cross Referenced for CommonFunctionStrIsRegExprMatchTag.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.ConceptTagCharacteristic;
021:        import org.jfolder.common.tagging.ConceptTagConstraint;
022:        import org.jfolder.common.tagging.ConceptTagConstraintHolder;
023:        import org.jfolder.common.tagging.ConceptTagFlagsHelper;
024:        import org.jfolder.common.tagging.DetermineClassConceptTagContext;
025:        import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
026:        import org.jfolder.common.tagging.DetermineValueAndClassConceptTagException;
027:        import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
028:        import org.jfolder.common.tagging.InitializeConceptTagContext;
029:        import org.jfolder.common.tagging.SelectionCriteriaForReturnableConceptTag;
030:        import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
031:        import org.jfolder.common.tagging.StudioConceptTagCreParInfoContext;
032:        import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
033:        import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
034:        import org.jfolder.common.tagging.ValueAndClassForConceptTag;
035:        import org.jfolder.common.utils.misc.MiscHelper;
036:
037:        //other classes
038:
039:        public class CommonFunctionStrIsRegExprMatchTag extends
040:                BaseCommonFunctionCompatibilityTag implements 
041:                SelfArgumentlessConstructor {
042:
043:            //
044:            private ConceptTagCharacteristic patternCtchar = null;
045:            private ConceptTagCharacteristic valueCtchar = null;
046:
047:            //variable details
048:            private final static String PATTERN_CTCON = "pattern";
049:            private final static String PATTERN_TITLE = "Pattern to match";
050:            private final static String PATTERN_SHORT_DESCRIPTION = "Pattern compared against value";
051:
052:            //value details
053:            private final static String VALUE_CTCON = "value";
054:            private final static String VALUE_TITLE = "Value";
055:            private final static String VALUE_SHORT_DESCRIPTION = "Value of this string";
056:
057:            //
058:
059:            public void initialize(InitializeConceptTagContext inIctc) {
060:
061:                //
062:                ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
063:                        .newInstance(inIctc);
064:                //
065:                //rootCtconh.getAttributes().setStudioVisibleOnlyOnError(true);
066:                //rootCtconh.getStyles().setStudioVisibleOnlyOnError(true);
067:
068:                //constrain "pattern"
069:                ConceptTagConstraint patternCtcon = ConceptTagConstraint
070:                        .newInstance(PATTERN_CTCON, rootCtconh);
071:                patternCtcon.setTitle(PATTERN_TITLE);
072:                patternCtcon.setShortDescription(PATTERN_SHORT_DESCRIPTION);
073:                patternCtcon.setMinimumLength(1);
074:                patternCtcon.setMaximumLength(1);
075:                //
076:                StaticConceptTagConstraintContext patternSctcc = StaticConceptTagConstraintContext
077:                        .newInstance(patternCtcon);
078:                //
079:                patternSctcc.addDefaultValue("PatternHere");
080:                //
081:
082:                //constrain "value"
083:                ConceptTagConstraint valueCtcon = ConceptTagConstraint
084:                        .newInstance(VALUE_CTCON, rootCtconh);
085:                valueCtcon.setTitle(VALUE_TITLE);
086:                valueCtcon.setShortDescription(VALUE_SHORT_DESCRIPTION);
087:                valueCtcon.setMinimumLength(1);
088:                valueCtcon.setMaximumLength(1);
089:                //
090:                DynamicConceptTagConstraintContext valueDctcc = DynamicConceptTagConstraintContext
091:                        .newInstance(valueCtcon);
092:                valueDctcc.getValidator().filterDirectChildOfRootAndHtml();
093:
094:                //
095:                ConceptTagConstraint unconstrainedCtcon = rootCtconh
096:                        .getUndefinedConstraint();
097:                //unconstrainedCtcon.setStudioVisibleOnlyOnError(true);
098:
099:                //
100:                ConceptTagFlagsHelper
101:                        .pushNonIterativeCommonFunctionDepth(inIctc);
102:                inIctc.initialize();
103:                ConceptTagFlagsHelper
104:                        .popNonIterativeCommonFunctionDepth(inIctc);
105:
106:                //
107:                //post initialization validation
108:                //TO DO: compare class against value
109:
110:                //
111:                this .patternCtchar = patternCtcon.getCharacteristic();
112:                this .valueCtchar = valueCtcon.getCharacteristic();
113:            }
114:
115:            public void appraise(AppraiseConceptTagContext inActc) {
116:
117:                if (inActc instanceof  StudioConceptTagInstanceInfoContext) {
118:
119:                    StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inActc;
120:
121:                    sctiic.setInstanceTitle("Compare To RegEx");
122:                    sctiic.setInstanceDescription("Compare To RegEx");
123:                } else if (inActc instanceof  StudioConceptTagTypeInfoContext) {
124:
125:                    StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inActc;
126:
127:                    scttic.setTypeTitle("Compare To RegEx");
128:                    scttic.setTypeDescription("Compare To RegEx");
129:                } else if (inActc instanceof  WebPageTagInstanceViewContext) {
130:
131:                    WebPageTagInstanceViewContext wptivc = (WebPageTagInstanceViewContext) inActc;
132:
133:                    WebPageTagInstanceViewContextInfo info = wptivc
134:                            .getInfoAsNonHtml();
135:
136:                    //
137:                    //
138:                    WebPageTagInstanceViewContextInfo addInfo = info
139:                            .createNonHtmlInfo();
140:                    addInfo.setNonHtmlContent("Compare String (");
141:                    WebPageTagInstanceViewContext.displayView(this .valueCtchar,
142:                            addInfo, wptivc, "???");
143:                    //
144:                    //
145:                    WebPageTagInstanceViewContextInfo indexInfo = info
146:                            .createNonHtmlInfo();
147:                    //if (this.indexCtchar.getValueLength() > 0) {
148:                    indexInfo.setNonHtmlContent(") To Expression (", ")");
149:                    WebPageTagInstanceViewContext.displayView(
150:                            this .patternCtchar, indexInfo, wptivc, "???");
151:                    //indexInfo.setEndContent(")");
152:                    //}
153:                    //else {
154:                    //    indexInfo.setStartContent(") To The End Of (");
155:                    //}
156:                    //
157:                    //
158:                    //
159:                    //WebPageTagInstanceViewContextInfo listInfo =
160:                    //    info.createNonHtmlInfo();
161:                    //WebPageTagInstanceViewContext.displayView(
162:                    //    this.listCtchar, listInfo, wptivc);
163:                } else if (inActc instanceof  SelectionCriteriaForReturnableConceptTag) {
164:
165:                    SelectionCriteriaForReturnableConceptTag scfrct = (SelectionCriteriaForReturnableConceptTag) inActc;
166:
167:                    scfrct.canReturnBoolean();
168:                    scfrct.declareFormatAsPlain();
169:                } else if (inActc instanceof  StudioConceptTagCreParInfoContext) {
170:
171:                    StudioConceptTagCreParInfoContext scpc = (StudioConceptTagCreParInfoContext) inActc;
172:                }
173:            }
174:
175:            public void determineValueAndClass(
176:                    DetermineValueAndClassConceptTagContext inDvacctc) {
177:
178:                try {
179:                    ValueAndClassForConceptTag vacfct = null;
180:
181:                    String pattern = this .patternCtchar.getValueAsString(0,
182:                            inDvacctc);
183:                    ValueAndClassForConceptTag valueVac = this .valueCtchar
184:                            .getDetermineValueAndClass(0, inDvacctc);
185:                    boolean result = MiscHelper.isRegularExpressionMatch(
186:                            valueVac.getValue().toString(), pattern, false);
187:
188:                    vacfct = ValueAndClassForConceptTag.newBoolean(new Boolean(
189:                            result));
190:
191:                    inDvacctc.setDetermineValueAndClass(vacfct);
192:                } catch (DetermineValueAndClassConceptTagException dvaccte) {
193:                    inDvacctc.setDetermineException(dvaccte);
194:                }
195:            }
196:
197:            public void determineClass(DetermineClassConceptTagContext inDcctc) {
198:
199:                inDcctc.setDetermineClass(StandardDataTypes.getBooleanClass());
200:            }
201:
202:            public Object createUninitializedSelf() {
203:                return new CommonFunctionStrIsRegExprMatchTag();
204:            }
205:
206:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.