[jboss-cvs] JBossAS SVN: r99517 - projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Jan 17 23:31:21 EST 2010


Author: ALRubinger
Date: 2010-01-17 23:31:20 -0500 (Sun, 17 Jan 2010)
New Revision: 99517

Added:
   projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/BootstrapDescriptorBase.java
Modified:
   projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/ClassLoaderResourceBootstrapDescriptor.java
   projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/FileBootstrapDescriptor.java
   projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/UrlBootstrapDescriptor.java
Log:
[JBBOOT-118] Create base support for BootstrapDescriptor implementations along w/ a toString method

Added: projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/BootstrapDescriptorBase.java
===================================================================
--- projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/BootstrapDescriptorBase.java	                        (rev 0)
+++ projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/BootstrapDescriptorBase.java	2010-01-18 04:31:20 UTC (rev 99517)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bootstrap.api.descriptor;
+
+/**
+ * Base support for {@link BootstrapDescriptor} implementations
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+abstract class BootstrapDescriptorBase implements BootstrapDescriptor
+{
+
+   //-------------------------------------------------------------------------------------||
+   // Class Members ----------------------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+
+   /*
+    * Constants used in constructing the toString representation
+    */
+
+   private static final String OPEN = "[";
+
+   private static final String CLOSE = "]";
+
+   private static final String COLON = ": ";
+
+   //-------------------------------------------------------------------------------------||
+   // Overridden Implementations ---------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+
+   /**
+    * @see java.lang.Object#toString()
+    */
+   @Override
+   public String toString()
+   {
+      return new StringBuilder().append(OPEN).append(this.getClass().getSimpleName()).append(CLOSE).append(COLON)
+            .append(this.getName()).toString();
+   }
+
+}

Modified: projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/ClassLoaderResourceBootstrapDescriptor.java
===================================================================
--- projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/ClassLoaderResourceBootstrapDescriptor.java	2010-01-18 04:22:03 UTC (rev 99516)
+++ projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/ClassLoaderResourceBootstrapDescriptor.java	2010-01-18 04:31:20 UTC (rev 99517)
@@ -33,7 +33,7 @@
  *
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  */
-public class ClassLoaderResourceBootstrapDescriptor implements BootstrapDescriptor
+public class ClassLoaderResourceBootstrapDescriptor extends BootstrapDescriptorBase implements BootstrapDescriptor
 {
 
    //-------------------------------------------------------------------------------------||

Modified: projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/FileBootstrapDescriptor.java
===================================================================
--- projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/FileBootstrapDescriptor.java	2010-01-18 04:22:03 UTC (rev 99516)
+++ projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/FileBootstrapDescriptor.java	2010-01-18 04:31:20 UTC (rev 99517)
@@ -32,7 +32,7 @@
  *
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  */
-public class FileBootstrapDescriptor implements BootstrapDescriptor
+public class FileBootstrapDescriptor extends BootstrapDescriptorBase implements BootstrapDescriptor
 {
 
    //-------------------------------------------------------------------------------------||

Modified: projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/UrlBootstrapDescriptor.java
===================================================================
--- projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/UrlBootstrapDescriptor.java	2010-01-18 04:22:03 UTC (rev 99516)
+++ projects/bootstrap/trunk/api/src/main/java/org/jboss/bootstrap/api/descriptor/UrlBootstrapDescriptor.java	2010-01-18 04:31:20 UTC (rev 99517)
@@ -31,7 +31,7 @@
  *
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  */
-public class UrlBootstrapDescriptor implements BootstrapDescriptor
+public class UrlBootstrapDescriptor extends BootstrapDescriptorBase implements BootstrapDescriptor
 {
 
    //-------------------------------------------------------------------------------------||




More information about the jboss-cvs-commits mailing list