Skip to content

Commit 29e145d

Browse files
authored
Merge pull request #309 from bci-oss/feature/OMP-SDK-XXX-improve-display-of-error-messages
Improve display of error messages (error line numbers and error text)
2 parents 79544f2 + cf1a8ac commit 29e145d

File tree

29 files changed

+2169
-54
lines changed

29 files changed

+2169
-54
lines changed

core/esmf-aspect-meta-model-resolver/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<packaging>jar</packaging>
3030

3131
<properties>
32-
<samm-revision>https://raw.githubusercontent.com/eclipse-esmf/esmf-semantic-aspect-meta-model/5c097dd7357b129ba1771985a9ab1d29fcc32bcd</samm-revision>
32+
<samm-revision>https://raw.githubusercontent.com/eclipse-esmf/esmf-semantic-aspect-meta-model/34468bf</samm-revision>
3333
</properties>
3434

3535
<dependencies>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
3+
*
4+
* See the AUTHORS file(s) distributed with this work for additional
5+
* information regarding authorship.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
*
11+
* SPDX-License-Identifier: MPL-2.0
12+
*/
13+
14+
package org.apache.jena.graph;
15+
16+
import org.eclipse.esmf.aspectmodel.resolver.parser.SmartToken;
17+
18+
/**
19+
* Because of some internal implementation details in Jena library, it was not possible
20+
* to extend all node types via one wrapper node; as a workaround each node type must have its own extension.
21+
*/
22+
public class AnyNode extends Node_ANY {
23+
private final SmartToken token;
24+
25+
public AnyNode( final SmartToken token ) {
26+
super();
27+
this.token = token;
28+
}
29+
30+
public SmartToken getToken() {
31+
return token;
32+
}
33+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
3+
*
4+
* See the AUTHORS file(s) distributed with this work for additional
5+
* information regarding authorship.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
*
11+
* SPDX-License-Identifier: MPL-2.0
12+
*/
13+
14+
package org.apache.jena.graph;
15+
16+
import org.eclipse.esmf.aspectmodel.resolver.parser.SmartToken;
17+
18+
/**
19+
* Because of some internal implementation details in Jena library, it was not possible
20+
* to extend all node types via one wrapper node; as a workaround each node type must have its own extension.
21+
*/
22+
public class BlankNode extends Node_Blank {
23+
24+
private final SmartToken token;
25+
26+
public BlankNode( final Node_Blank original, final SmartToken token ) {
27+
super( original.getBlankNodeId() );
28+
this.token = token;
29+
}
30+
31+
public SmartToken getToken() {
32+
return token;
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
3+
*
4+
* See the AUTHORS file(s) distributed with this work for additional
5+
* information regarding authorship.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
*
11+
* SPDX-License-Identifier: MPL-2.0
12+
*/
13+
14+
package org.apache.jena.graph;
15+
16+
import org.eclipse.esmf.aspectmodel.resolver.parser.SmartToken;
17+
18+
/**
19+
* Because of some internal implementation details in Jena library, it was not possible
20+
* to extend all node types via one wrapper node; as a workaround each node type must have its own extension.
21+
*/
22+
public class LiteralNode extends Node_Literal {
23+
24+
private final SmartToken token;
25+
26+
public LiteralNode( final Node_Literal node, final SmartToken token ) {
27+
super( node.getLiteral() );
28+
this.token = token;
29+
}
30+
31+
public SmartToken getToken() {
32+
return token;
33+
}
34+
}
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
/*
2+
* Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
3+
*
4+
* See the AUTHORS file(s) distributed with this work for additional
5+
* information regarding authorship.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
*
11+
* SPDX-License-Identifier: MPL-2.0
12+
*/
13+
14+
package org.apache.jena.graph;
15+
16+
import java.io.ObjectStreamException;
17+
18+
import org.apache.jena.datatypes.RDFDatatype;
19+
import org.apache.jena.graph.impl.LiteralLabel;
20+
import org.apache.jena.riot.tokens.Token;
21+
import org.apache.jena.shared.PrefixMapping;
22+
import org.eclipse.esmf.aspectmodel.resolver.parser.SmartToken;
23+
24+
public class TokenNode extends Node {
25+
private final SmartToken token;
26+
private final Node wrappedNode;
27+
28+
public TokenNode( final Node wrappedNode, final Token token ) {
29+
super( wrappedNode.label );
30+
this.wrappedNode = wrappedNode;
31+
this.token = new SmartToken( token );
32+
}
33+
34+
@Override
35+
public Object visitWith( final NodeVisitor visitor ) {
36+
return wrappedNode.visitWith( visitor );
37+
}
38+
39+
@Override
40+
public boolean isConcrete() {
41+
return wrappedNode.isConcrete();
42+
}
43+
44+
@Override
45+
public boolean equals( final Object o ) {
46+
return wrappedNode.equals( o instanceof TokenNode ? ((TokenNode) o).wrappedNode : o );
47+
}
48+
49+
public SmartToken getToken() {
50+
return token;
51+
}
52+
53+
@Override
54+
public boolean isLiteral() {
55+
return wrappedNode.isLiteral();
56+
}
57+
58+
@Override
59+
public boolean isBlank() {
60+
return wrappedNode.isBlank();
61+
}
62+
63+
@Override
64+
public boolean isURI() {
65+
return wrappedNode.isURI();
66+
}
67+
68+
@Override
69+
public boolean isVariable() {
70+
return wrappedNode.isVariable();
71+
}
72+
73+
@Override
74+
public boolean isNodeTriple() {
75+
return wrappedNode.isNodeTriple();
76+
}
77+
78+
@Override
79+
public boolean isNodeGraph() {
80+
return wrappedNode.isNodeGraph();
81+
}
82+
83+
@Override
84+
public boolean isExt() {
85+
return wrappedNode.isExt();
86+
}
87+
88+
@Override
89+
public BlankNodeId getBlankNodeId() {
90+
return wrappedNode.getBlankNodeId();
91+
}
92+
93+
@Override
94+
public String getBlankNodeLabel() {
95+
return wrappedNode.getBlankNodeLabel();
96+
}
97+
98+
@Override
99+
public LiteralLabel getLiteral() {
100+
return wrappedNode.getLiteral();
101+
}
102+
103+
@Override
104+
public Object getLiteralValue() {
105+
return wrappedNode.getLiteralValue();
106+
}
107+
108+
@Override
109+
public String getLiteralLexicalForm() {
110+
return wrappedNode.getLiteralLexicalForm();
111+
}
112+
113+
@Override
114+
public String getLiteralLanguage() {
115+
return wrappedNode.getLiteralLanguage();
116+
}
117+
118+
@Override
119+
public String getLiteralDatatypeURI() {
120+
return wrappedNode.getLiteralDatatypeURI();
121+
}
122+
123+
@Override
124+
public RDFDatatype getLiteralDatatype() {
125+
return wrappedNode.getLiteralDatatype();
126+
}
127+
128+
@Override
129+
public boolean getLiteralIsXML() {
130+
return wrappedNode.getLiteralIsXML();
131+
}
132+
133+
@Override
134+
public Object getIndexingValue() {
135+
return wrappedNode.getIndexingValue();
136+
}
137+
138+
@Override
139+
public String getURI() {
140+
return wrappedNode.getURI();
141+
}
142+
143+
@Override
144+
public String getNameSpace() {
145+
return wrappedNode.getNameSpace();
146+
}
147+
148+
@Override
149+
public String getLocalName() {
150+
return wrappedNode.getLocalName();
151+
}
152+
153+
@Override
154+
public String getName() {
155+
return wrappedNode.getName();
156+
}
157+
158+
@Override
159+
public Triple getTriple() {
160+
return wrappedNode.getTriple();
161+
}
162+
163+
@Override
164+
public Graph getGraph() {
165+
return wrappedNode.getGraph();
166+
}
167+
168+
@Override
169+
public boolean hasURI( final String uri ) {
170+
return wrappedNode.hasURI( uri );
171+
}
172+
173+
@Override
174+
public boolean sameValueAs( final Object o ) {
175+
return wrappedNode.sameValueAs( o );
176+
}
177+
178+
@Override
179+
public int hashCode() {
180+
return wrappedNode.hashCode();
181+
}
182+
183+
@Override
184+
public boolean matches( final Node other ) {
185+
return wrappedNode.matches( other );
186+
}
187+
188+
@Override
189+
protected Object writeReplace() throws ObjectStreamException {
190+
return wrappedNode.writeReplace();
191+
}
192+
193+
@Override
194+
public String toString() {
195+
return wrappedNode.toString();
196+
}
197+
198+
@Override
199+
public String toString( final boolean quoting ) {
200+
return wrappedNode.toString( quoting );
201+
}
202+
203+
@Override
204+
public String toString( final PrefixMapping pm ) {
205+
return wrappedNode.toString( pm );
206+
}
207+
208+
@Override
209+
public String toString( final PrefixMapping pm, final boolean quoting ) {
210+
return wrappedNode.toString( pm, quoting );
211+
}
212+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
3+
*
4+
* See the AUTHORS file(s) distributed with this work for additional
5+
* information regarding authorship.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
*
11+
* SPDX-License-Identifier: MPL-2.0
12+
*/
13+
14+
package org.apache.jena.graph;
15+
16+
import org.eclipse.esmf.aspectmodel.resolver.parser.SmartToken;
17+
18+
/**
19+
* Because of some internal implementation details in Jena library, it was not possible
20+
* to extend all node types via one wrapper node; as a workaround each node type must have its own extension.
21+
*/
22+
public class UriNode extends Node_URI {
23+
24+
private final SmartToken token;
25+
26+
public UriNode( final Node_URI nodeUri, final SmartToken token ) {
27+
super( nodeUri.getURI() );
28+
this.token = token;
29+
}
30+
31+
public SmartToken getToken() {
32+
return token;
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
3+
*
4+
* See the AUTHORS file(s) distributed with this work for additional
5+
* information regarding authorship.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
*
11+
* SPDX-License-Identifier: MPL-2.0
12+
*/
13+
14+
package org.apache.jena.graph;
15+
16+
import org.eclipse.esmf.aspectmodel.resolver.parser.SmartToken;
17+
18+
/**
19+
* Because of some internal implementation details in Jena library, it was not possible
20+
* to extend all node types via one wrapper node; as a workaround each node type must have its own extension.
21+
*/
22+
public class VariableNode extends Node_Variable {
23+
24+
private final SmartToken token;
25+
26+
public VariableNode( final String name, final SmartToken token ) {
27+
super( name );
28+
this.token = token;
29+
}
30+
31+
public SmartToken getToken() {
32+
return token;
33+
}
34+
}

0 commit comments

Comments
 (0)