|
|
@@ -1,18 +1,18 @@ |
|
|
/* |
|
|
* The MIT License |
|
|
* |
|
|
* |
|
|
* Copyright (c) 2004-2011, Sun Microsystems, Inc., Kohsuke Kawaguchi |
|
|
* |
|
|
* |
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
|
* of this software and associated documentation files (the "Software"), to deal |
|
|
* in the Software without restriction, including without limitation the rights |
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
|
* copies of the Software, and to permit persons to whom the Software is |
|
|
* furnished to do so, subject to the following conditions: |
|
|
* |
|
|
* |
|
|
* The above copyright notice and this permission notice shall be included in |
|
|
* all copies or substantial portions of the Software. |
|
|
* |
|
|
* |
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
@@ -117,7 +117,7 @@ |
|
|
* {@link Descriptor} defines addition to the standard Java reflection |
|
|
* and provides reflective information about its corresponding {@link Describable}. |
|
|
* These are primarily used by tag libraries to |
|
|
* keep the Jelly scripts concise. |
|
|
* keep the Jelly scripts concise. |
|
|
* |
|
|
* @author Kohsuke Kawaguchi |
|
|
* @see Describable |
|
@@ -222,7 +222,7 @@ public Descriptor getItemTypeDescriptorOrDie() { |
|
|
/** |
|
|
* Help file redirect, keyed by the field name to the path. |
|
|
* |
|
|
* @see #getHelpFile(String) |
|
|
* @see #getHelpFile(String) |
|
|
*/ |
|
|
private transient final Map<String,HelpRedirect> helpRedirect = new HashMap<String,HelpRedirect>(); |
|
|
|
|
@@ -260,7 +260,7 @@ protected Descriptor(Class<? extends T> clazz) { |
|
|
* Infers the type of the corresponding {@link Describable} from the outer class. |
|
|
* This version works when you follow the common convention, where a descriptor |
|
|
* is written as the static nested class of the describable class. |
|
|
* |
|
|
* |
|
|
* @since 1.278 |
|
|
*/ |
|
|
protected Descriptor() { |
|
@@ -309,7 +309,7 @@ protected Descriptor() { |
|
|
* |
|
|
* @return |
|
|
* Stick to valid Java identifier character, plus '.', which had to be allowed for historical reasons. |
|
|
* |
|
|
* |
|
|
* @since 1.391 |
|
|
*/ |
|
|
public String getId() { |
|
@@ -510,7 +510,7 @@ public final String getJsonSafeClassName() { |
|
|
/** |
|
|
* @deprecated |
|
|
* Implement {@link #newInstance(StaplerRequest, JSONObject)} method instead. |
|
|
* Deprecated as of 1.145. |
|
|
* Deprecated as of 1.145. |
|
|
*/ |
|
|
public T newInstance(StaplerRequest req) throws FormException { |
|
|
throw new UnsupportedOperationException(getClass()+" should implement newInstance(StaplerRequest,JSONObject)"); |
|
@@ -656,7 +656,7 @@ public String getHelpFile(Klass<?> clazz, String fieldName) { |
|
|
} |
|
|
return null; |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
* Tells Jenkins that the help file for the field 'fieldName' is defined in the help file for |
|
|
* the 'fieldNameToRedirectTo' in the 'owner' class. |
|
@@ -711,7 +711,7 @@ public String getConfigPage() { |
|
|
public String getGlobalConfigPage() { |
|
|
return getViewPage(clazz, getPossibleViewNames("global"), null); |
|
|
} |
|
|
|
|
|
|
|
|
private String getViewPage(Class<?> clazz, String pageName, String defaultValue) { |
|
|
return getViewPage(clazz,Collections.singleton(pageName),defaultValue); |
|
|
} |
|
@@ -918,6 +918,7 @@ private URL getStaticHelpUrl(Klass<?> c, String suffix) { |
|
|
if (d != null) { |
|
|
items.add(d.newInstance(req, jo)); |
|
|
} |
|
|
LOGGER.warning("Received unexpected formData for descriptor " + kind); |
|
|
} |
|
|
} |
|
|
|
|
@@ -929,7 +930,7 @@ private URL getStaticHelpUrl(Klass<?> c, String suffix) { |
|
|
*/ |
|
|
public static @CheckForNull <T extends Descriptor> T find(Collection<? extends T> list, String className) { |
|
|
for (T d : list) { |
|
|
if(d.getClass().getName().equals(className)) |
|
|
if(d.clazz.getName().equals(className)) |
|
|
return d; |
|
|
} |
|
|
// Since we introduced Descriptor.getId(), it is a preferred method of identifying descriptor by a string. |
|
|