Skip to content

Commit 636f516

Browse files
committed
[E4 Xpath] Unify and clean-up definitions of generic type arguments
1 parent ddc5ea1 commit 636f516

File tree

4 files changed

+24
-32
lines changed

4 files changed

+24
-32
lines changed

bundles/org.eclipse.e4.emf.xpath/src/org/eclipse/e4/emf/internal/xpath/JXPathContextFactoryImpl.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2015 BestSolution.at and others.
2+
* Copyright (c) 2010, 2024 BestSolution.at and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -20,18 +20,17 @@
2020
/**
2121
* Factory creating context using JXPath
2222
*
23-
* @param <Type>
24-
* the object the XPath is created for
23+
* @param <T> the object the XPath is created for
2524
*/
26-
public class JXPathContextFactoryImpl<Type> extends XPathContextFactory<Type> {
25+
public class JXPathContextFactoryImpl<T> extends XPathContextFactory<T> {
2726

2827
@Override
2928
public XPathContext newContext(XPathContext parentContext, Object contextBean) {
3029
return new JXPathContextImpl(parentContext, contextBean);
3130
}
3231

3332
@Override
34-
public XPathContext newContext(Type contextBean) {
33+
public XPathContext newContext(T contextBean) {
3534
return new JXPathContextImpl(contextBean);
3635
}
3736

bundles/org.eclipse.e4.emf.xpath/src/org/eclipse/e4/emf/internal/xpath/JXPathContextImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public Object getValue(String xpath, Class<?> requiredType) {
8989
}
9090

9191
@Override
92-
public <Type> Iterator<Type> iterate(String xpath) {
92+
public <T> Iterator<T> iterate(String xpath) {
9393
return context.iterate(xpath);
9494
}
9595

bundles/org.eclipse.e4.emf.xpath/src/org/eclipse/e4/emf/xpath/XPathContext.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2015 BestSolution.at and others.
2+
* Copyright (c) 2010, 2024 BestSolution.at and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -46,15 +46,13 @@ public interface XPathContext {
4646

4747
/**
4848
* Traverses the xpath and returns an Iterator of all results found for the
49-
* path. If the xpath matches no properties in the graph, the Iterator will
50-
* be empty, but not null.
49+
* path. If the xpath matches no properties in the graph, the Iterator will be
50+
* empty, but not null.
5151
*
52-
* @param <O>
53-
* the expected object type
52+
* @param <T> the expected object type
5453
*
55-
* @param xpath
56-
* to iterate
54+
* @param xpath to iterate
5755
* @return Iterator&lt;Object&gt;
5856
*/
59-
<O> Iterator<O> iterate(String xpath);
57+
<T> Iterator<T> iterate(String xpath);
6058
}
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2015 BestSolution.at and others.
2+
* Copyright (c) 2010, 2024 BestSolution.at and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -18,39 +18,34 @@
1818
/**
1919
* Factory responsible to create an XPath-Context
2020
*
21-
* @param <Type>
22-
* the object type the XPath is created for
21+
* @param <T> the object type the XPath is created for
2322
*/
24-
public abstract class XPathContextFactory<Type extends Object> {
23+
public abstract class XPathContextFactory<T> {
2524

2625
/**
2726
* Creates a new XPathContext with the specified object as the root node.
2827
*
29-
* @param contextBean
30-
* Object
28+
* @param contextBean Object
3129
* @return XPathContext
3230
*/
33-
public abstract XPathContext newContext(Type contextBean);
31+
public abstract XPathContext newContext(T contextBean);
3432

3533
/**
36-
* Creates a new XPathContext with the specified bean as the root node and
37-
* the specified parent context. Variables defined in a parent context can
38-
* be referenced in XPaths passed to the child context.
34+
* Creates a new XPathContext with the specified bean as the root node and the
35+
* specified parent context. Variables defined in a parent context can be
36+
* referenced in XPaths passed to the child context.
3937
*
40-
* @param parentContext
41-
* parent context
42-
* @param contextBean
43-
* Object
38+
* @param parentContext parent context
39+
* @param contextBean Object
4440
* @return XPathContext
4541
*/
46-
public abstract XPathContext newContext(XPathContext parentContext, Type contextBean);
42+
public abstract XPathContext newContext(XPathContext parentContext, T contextBean);
4743

4844
/**
49-
* @param <Type>
50-
* the object type the xpath is created for
45+
* @param <T> the object type the xpath is created for
5146
* @return Create a new XPath-Factory
5247
*/
53-
public static <Type> XPathContextFactory<Type> newInstance() {
48+
public static <T> XPathContextFactory<T> newInstance() {
5449
return new JXPathContextFactoryImpl<>();
5550
}
5651
}

0 commit comments

Comments
 (0)