aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-10-16 00:00:50 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-10-16 00:00:50 +0000
commitdfbab3ff6af87898de6101ea827db7e75cecca61 (patch)
treed78ec6e6c89ae27dd9176ad548266b093f822293 /poi
parentf406fe798f3380a8944a7c8704c0987ab01377d3 (diff)
downloadpoi-dfbab3ff6af87898de6101ea827db7e75cecca61.tar.gz
poi-dfbab3ff6af87898de6101ea827db7e75cecca61.zip
#64036 - Replace reflection calls in factories for Java 9+
use ServiceLoader for HSLF Metro Shapes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/MetroShapeProvider.java31
-rw-r--r--poi/src/test/java9/module-info.classbin4145 -> 4198 bytes
-rw-r--r--poi/src/test/java9/module-info.java2
3 files changed, 33 insertions, 0 deletions
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/MetroShapeProvider.java b/poi/src/main/java/org/apache/poi/sl/usermodel/MetroShapeProvider.java
new file mode 100644
index 0000000000..e89a14df56
--- /dev/null
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/MetroShapeProvider.java
@@ -0,0 +1,31 @@
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.sl.usermodel;
+
+import java.io.IOException;
+
+import org.apache.poi.util.Internal;
+
+/**
+ * Experimental provider / loader for metro shapes.
+ * Metro shapes are xslf fragments stored in hslf shapes.
+ */
+@Internal
+public interface MetroShapeProvider {
+ Shape<?,?> parseShape(byte[] metroBytes) throws IOException;
+}
diff --git a/poi/src/test/java9/module-info.class b/poi/src/test/java9/module-info.class
index 028b943d0a..438e778ab5 100644
--- a/poi/src/test/java9/module-info.class
+++ b/poi/src/test/java9/module-info.class
Binary files differ
diff --git a/poi/src/test/java9/module-info.java b/poi/src/test/java9/module-info.java
index 58ac2220c5..7b9cf162cf 100644
--- a/poi/src/test/java9/module-info.java
+++ b/poi/src/test/java9/module-info.java
@@ -24,6 +24,8 @@ module org.apache.poi.poi {
requires java.logging;
requires java.desktop;
+ uses org.apache.poi.sl.usermodel.MetroShapeProvider;
+
/* needed for CleanerUtil */
requires jdk.unsupported;