Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ParserImpl |
|
| 2.0;2 |
1 | /* | |
2 | wsmo4j - a WSMO API and Reference Implementation | |
3 | ||
4 | Copyright (c) 2004-2005, OntoText Lab. / SIRMA | |
5 | ||
6 | This library is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU Lesser General Public License as published by the Free | |
8 | Software Foundation; either version 2.1 of the License, or (at your option) | |
9 | any later version. | |
10 | This library is distributed in the hope that it will be useful, but WITHOUT | |
11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
12 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | |
13 | details. | |
14 | You should have received a copy of the GNU Lesser General Public License along | |
15 | with this library; if not, write to the Free Software Foundation, Inc., | |
16 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 | */ | |
18 | ||
19 | /** | |
20 | * <p>Title: WSMO4J</p> | |
21 | * <p>Description: WSMO API and a Reference Implementation</p> | |
22 | * <p>Copyright: Copyright (c) 2004-2005</p> | |
23 | * <p>Company: OntoText Lab. / SIRMA </p> | |
24 | */ | |
25 | ||
26 | package org.deri.wsmo4j.io.parser.wsml; | |
27 | ||
28 | import java.util.*; | |
29 | ||
30 | import org.deri.wsmo4j.choreography.*; | |
31 | import org.deri.wsmo4j.orchestration.*; | |
32 | import org.wsmo.factory.*; | |
33 | ||
34 | import com.ontotext.wsmo4j.parser.wsml.*; | |
35 | ||
36 | public class ParserImpl extends com.ontotext.wsmo4j.parser.wsml.ParserImpl { | |
37 | ||
38 | //TODO: Find a better place to put the constant | |
39 | public final static String PARSER_CHOREOGRAPHY_FACTORY = "parser_choreography_factory"; | |
40 | public final static String PARSER_ORCHESTRATION_FACTORY = "parser_orchestration_factory"; | |
41 | ||
42 | protected ChoreographyFactory cFactory; | |
43 | ||
44 | protected OrchestrationFactory oFactory; | |
45 | ||
46 | public ParserImpl(Map map) { | |
47 | 0 | super(map); |
48 | 0 | Object o = map.get(PARSER_CHOREOGRAPHY_FACTORY); |
49 | 0 | if (o == null || !(o instanceof ChoreographyFactory)) { |
50 | //TODO: Use factory to create the ChoreographyFactory | |
51 | 0 | o = new ChoreographyFactoryRI(); |
52 | } | |
53 | 0 | cFactory = (ChoreographyFactory) o; |
54 | ||
55 | 0 | o = map.get(PARSER_ORCHESTRATION_FACTORY); |
56 | 0 | if (o == null || !(o instanceof OrchestrationFactory)) { |
57 | //TODO: Use factory to create the OrchestrationFactory | |
58 | 0 | o = new OrchestrationFactoryRI(); |
59 | } | |
60 | 0 | oFactory = (OrchestrationFactory) o; |
61 | 0 | } |
62 | ||
63 | protected ASTAnalysisContainer createContainer() { | |
64 | 0 | ASTAnalysisContainer container = super.createContainer(); |
65 | 0 | new ChoreographyAnalysis(container, cFactory, oFactory, factory); |
66 | 0 | new RuleAnalyzer(container, factory, oFactory, cFactory, LEFactory); |
67 | 0 | return container; |
68 | } | |
69 | } | |
70 | ||
71 | /* | |
72 | * $Log$ | |
73 | * Revision 1.10 2006/10/24 14:11:47 vassil_momtchev | |
74 | * choreography/orchestration rules refactored. different types where appropriate now supported | |
75 | * | |
76 | * Revision 1.9 2006/06/07 13:03:06 vassil_momtchev | |
77 | * orchestration factory added | |
78 | * | |
79 | * Revision 1.8 2006/04/17 07:56:00 vassil_momtchev | |
80 | * unused imports removed | |
81 | * | |
82 | * Revision 1.7 2006/03/24 15:39:18 vassil_momtchev | |
83 | * helper method parseCompoundFact(TopEntity nsHolder, String factText) removed; logic to be implemented by the applications that use wsmo4j | |
84 | * | |
85 | * Revision 1.6 2006/02/10 15:35:34 vassil_momtchev | |
86 | * new grammar implemented | |
87 | * | |
88 | * Revision 1.5 2006/01/09 15:31:55 alex_simov | |
89 | * Namespace serialization bugfix in compiling CompoundFact | |
90 | * | |
91 | * Revision 1.4 2005/12/21 13:55:10 vassil_momtchev | |
92 | * parseCompoundFact(TopEntity, String) return type changed from Set to List | |
93 | * | |
94 | * Revision 1.3 2005/12/21 13:30:15 vassil_momtchev | |
95 | * helper method parse compoundfact added | |
96 | * | |
97 | * Revision 1.2 2005/12/21 11:40:19 vassil_momtchev | |
98 | * rule analyzer added | |
99 | * | |
100 | * Revision 1.1 2005/11/28 16:00:41 vassil_momtchev | |
101 | * choreography parser added extending com.ontotext.wsmo4j.parser.wsml.ParserImpl (ParserImpl.java) | |
102 | * AST analysis of choreography (ChoreographyAnalysis.java) | |
103 | * | |
104 | */ |