Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JEuclid Core Source Code Files
JEuclid Source Code Files are provided
the
JEuclid GitHub Website.
You can browse JEuclid Source Code files below:
✍: FYIcenter
⏎ net/sourceforge/jeuclid/converter/BatikDetector.java
/*
* Copyright 2007 - 2007 JEuclid, http://jeuclid.sf.net
*
* Licensed 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.
*/
/* $Id$ */
package net.sourceforge.jeuclid.converter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import net.sourceforge.jeuclid.elements.generic.JEuclidDOMImplementation;
import net.sourceforge.jeuclid.elements.support.ClassLoaderSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.DOMImplementation;
/**
* Detects if Batik is in the class path and registers it if its available.
*
* @version $Revision$
*/
public final class BatikDetector implements ConverterDetector {
/**
* Logger for this class
*/
private static final Log LOGGER = LogFactory.getLog(BatikDetector.class);
/**
* Default constructor.
*/
public BatikDetector() {
// Empty on purpose
}
private static DOMImplementation findSVGDOMImplementation() {
DOMImplementation impl;
try {
final Class<?> svgdomimpl = ClassLoaderSupport.getInstance()
.loadClass(
"org.apache.batik.anim.dom.SVGDOMImplementation");
final Method getDOMimpl = svgdomimpl.getMethod(
"getDOMImplementation", new Class<?>[] {});
impl = (DOMImplementation) getDOMimpl.invoke(null,
(Object[]) null);
// CHECKSTYLE:OFF
// In this case, ANY runtime exception must be caught, since batik
// may not be available.
} catch (final RuntimeException e) {
// CHECKSYTLE:ON
impl = null;
} catch (final LinkageError e) {
impl = null;
} catch (final ClassNotFoundException e) {
impl = null;
} catch (final NoSuchMethodException e) {
impl = null;
} catch (final IllegalAccessException e) {
impl = null;
} catch (final InvocationTargetException e) {
impl = null;
}
if (impl == null) {
impl = JEuclidDOMImplementation.getInstance();
}
return impl;
}
/**
* Detects if Batik is in the classpath.
*
* @param registry
* ConverterRegisty to register with.
*/
public void detectConversionPlugins(final ConverterRegistry registry) {
try {
ClassLoaderSupport.getInstance().loadClass(
"org.apache.batik.svggen.SVGGraphics2D");
BatikDetector.LOGGER.debug("Batik detected!");
registry
.registerMimeTypeAndSuffix(
net.sourceforge.jeuclid.converter.Converter.TYPE_SVG,
net.sourceforge.jeuclid.converter.Converter.EXTENSION_SVG,
true);
final DOMImplementation impl = BatikDetector
.findSVGDOMImplementation();
if (impl != null) {
registry.registerConverter(
net.sourceforge.jeuclid.converter.Converter.TYPE_SVG,
new BatikConverter(impl), true);
}
} catch (final ClassNotFoundException e) {
BatikDetector.LOGGER.debug("Batik is not in classpath!");
}
}
}
⏎ net/sourceforge/jeuclid/converter/BatikDetector.java
Or download all of them as a single archive file:
File name: jeuclid-core-3.1.14-fyi.zip File size: 325716 bytes Release date: 2019-02-24 Download
⇒ Using JEuclid 3.1.9 on macOS
⇐ Download and Install jeuclid-core-3.1.14.jar
2025-08-15, ≈32🔥, 0💬
Popular Posts:
How to download and install mysql-connector-j-8.0.31 .zip?Connector/J Java library is a JDBC Driver ...
How to download and install ojdbc11.jar for Oracle 21c? ojdbc11.jar for Oracle 21c is a Java JDBC Dr...
JDK 17 java.sql.rowset.jmod is the JMOD file for JDK 17 SQL Rowset module. JDK 17 SQL Rowset module ...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module. JDK 11 Desktop module compiled ...