commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r961817 - /commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
Date Thu, 08 Jul 2010 15:42:30 GMT
Author: simonetripodi
Date: Thu Jul  8 15:42:29 2010
New Revision: 961817

URL: http://svn.apache.org/viewvc?rev=961817&view=rev
Log:
first checkin of DefaultDigesterLoaderHandlerFactory class

Added:
    commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
  (with props)

Added: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java?rev=961817&view=auto
==============================================================================
--- commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
(added)
+++ commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
Thu Jul  8 15:42:29 2010
@@ -0,0 +1,49 @@
+/*
+ * 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.commons.digester.annotations.internal;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+
+import org.apache.commons.digester.annotations.DigesterLoaderHandler;
+import org.apache.commons.digester.annotations.DigesterLoadingException;
+import org.apache.commons.digester.annotations.spi.DigesterLoaderHandlerFactory;
+
+/**
+ * Default {@link DigesterLoaderHandlerFactory} implementation.
+ *
+ * @version $Id$
+ * @since 2.1
+ */
+public final class DefaultDigesterLoaderHandlerFactory implements DigesterLoaderHandlerFactory
{
+
+    /**
+     * {@inheritDoc}
+     */
+    public <A extends Annotation, E extends AnnotatedElement> DigesterLoaderHandler<A,
E> newInstance(
+            Class<? extends DigesterLoaderHandler<A, E>> type)
+            throws DigesterLoadingException {
+        try {
+            return type.newInstance();
+        } catch (Exception e) {
+            throw new DigesterLoadingException("An error occurred while creating '"
+                    + type
+                    + "' instance", e);
+        }
+    }
+
+}

Propchange: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/internal/DefaultDigesterLoaderHandlerFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message