提交 6ed3b1be 编写于 作者: K kohsuke

expose -> export


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3114 71c3de6d-444a-0410-be80-ed276b4c234a
上级 158a644b
......@@ -16,7 +16,7 @@
<plugin>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>maven-stapler-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<extensions>true</extensions>
</plugin>
<plugin>
......@@ -119,7 +119,7 @@
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
<version>1.29</version>
<version>1.30</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
......
......@@ -3,7 +3,7 @@ package hudson.model;
import hudson.Launcher;
import hudson.Proc.LocalProc;
import hudson.Util;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.Exported;
import hudson.tasks.Fingerprinter.FingerprintAction;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.maven.MavenBuild;
......@@ -87,7 +87,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
/**
* Returns the name of the slave it was built on, or null if it was the master.
*/
@Exposed(name="builtOn")
@Exported(name="builtOn")
public String getBuiltOnStr() {
return builtOn;
}
......@@ -179,7 +179,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
*
* @return never null.
*/
@Exposed
@Exported
public ChangeLogSet<? extends Entry> getChangeSet() {
if(scm==null)
scm = new CVSChangeLogParser();
......
......@@ -2,8 +2,8 @@ package hudson.model;
import hudson.XmlFile;
import hudson.Util;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import java.io.File;
import java.io.IOException;
......@@ -22,7 +22,7 @@ import javax.servlet.ServletException;
*/
// Item doesn't necessarily have to be Actionable, but
// Java doesn't let multiple inheritance.
@ExposedBean
@ExportedBean
public abstract class AbstractItem extends Actionable implements Item {
/**
* Project name.
......@@ -41,12 +41,12 @@ public abstract class AbstractItem extends Actionable implements Item {
doSetName(name);
}
@Exposed(visibility=2)
@Exported(visibility=2)
public String getName() {
return name;
}
@Exposed
@Exported
public String getDisplayName() {
return getName();
}
......@@ -63,7 +63,7 @@ public abstract class AbstractItem extends Actionable implements Item {
/**
* Gets the project description HTML.
*/
@Exposed
@Exported
public String getDescription() {
return description;
}
......@@ -121,7 +121,7 @@ public abstract class AbstractItem extends Actionable implements Item {
return getParent().getUrlChildPrefix()+'/'+getName()+'/';
}
@Exposed(visibility=2,name="url")
@Exported(visibility=2,name="url")
public final String getAbsoluteUrl() {
StaplerRequest request = Stapler.getCurrentRequest();
if(request==null)
......
......@@ -2,7 +2,7 @@ package hudson.model;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.Flavor;
import javax.servlet.ServletException;
......@@ -12,7 +12,7 @@ import java.io.IOException;
* Used to expose remote access API for ".../api/"
*
* @author Kohsuke Kawaguchi
* @see Exposed
* @see Exported
*/
public class Api extends AbstractModelObject {
/**
......
......@@ -13,7 +13,7 @@ import hudson.TcpSlaveAgentListener;
import hudson.Util;
import static hudson.Util.fixEmpty;
import hudson.XmlFile;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.Exported;
import hudson.model.Descriptor.FormException;
import hudson.model.listeners.ItemListener;
import hudson.model.listeners.JobListener;
......@@ -214,7 +214,7 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
return tcpSlaveAgentListener;
}
@Exposed
@Exported
public int getSlaveAgentPort() {
return slaveAgentPort;
}
......@@ -419,7 +419,7 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
*
* @see #getAllItems(Class)
*/
@Exposed(name="jobs")
@Exported(name="jobs")
public List<TopLevelItem> getItems() {
return new ArrayList<TopLevelItem>(items.values());
}
......
......@@ -2,7 +2,7 @@ package hudson.model;
import hudson.ExtensionPoint;
import hudson.Util;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.Exported;
import hudson.model.Descriptor.FormException;
import hudson.tasks.BuildTrigger;
import hudson.tasks.LogRotator;
......@@ -117,7 +117,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
getNextBuildNumberFile().write(String.valueOf(nextBuildNumber)+'\n');
}
@Exposed
@Exported
public boolean isInQueue() {
return false;
}
......@@ -125,7 +125,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* If this job is in the build queue, return its item.
*/
@Exposed
@Exported
public Queue.Item getQueueItem() {
return null;
}
......@@ -133,7 +133,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* If true, it will keep all the build logs of dependency components.
*/
@Exposed
@Exported
public boolean isKeepDependencies() {
return keepDependencies;
}
......@@ -150,7 +150,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Peeks the next build number.
*/
@Exposed
@Exported
public int getNextBuildNumber() {
return nextBuildNumber;
}
......@@ -286,7 +286,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Returns true if we should display "build now" icon
*/
@Exposed
@Exported
public abstract boolean isBuildable();
/**
......@@ -394,7 +394,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Returns the last build.
*/
@Exposed
@Exported
public RunT getLastBuild() {
SortedMap<Integer,? extends RunT> runs = _getRuns();
......@@ -405,7 +405,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Returns the oldest build in the record.
*/
@Exposed
@Exported
public RunT getFirstBuild() {
SortedMap<Integer,? extends RunT> runs = _getRuns();
......@@ -418,7 +418,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
* A stable build would include either {@link Result#SUCCESS} or {@link Result#UNSTABLE}.
* @see #getLastStableBuild()
*/
@Exposed
@Exported
public RunT getLastSuccessfulBuild() {
RunT r = getLastBuild();
// temporary hack till we figure out what's causing this bug
......@@ -430,7 +430,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Returns the last stable build, if any. Otherwise null.
*/
@Exposed
@Exported
public RunT getLastStableBuild() {
RunT r = getLastBuild();
while(r!=null && (r.isBuilding() || r.getResult().isWorseThan(Result.SUCCESS)))
......@@ -441,7 +441,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Returns the last failed build, if any. Otherwise null.
*/
@Exposed
@Exported
public RunT getLastFailedBuild() {
RunT r = getLastBuild();
while(r!=null && (r.isBuilding() || r.getResult()!=Result.FAILURE))
......@@ -452,7 +452,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
/**
* Used as the color of the status ball for the project.
*/
@Exposed(visibility=2,name="color")
@Exported(visibility=2,name="color")
public BallColor getIconColor() {
RunT lastBuild = getLastBuild();
while(lastBuild!=null && lastBuild.hasntStartedYet())
......
package hudson.model;
import hudson.Util;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.export.Exported;
import hudson.model.Node.Mode;
import hudson.util.OneShotEvent;
......@@ -469,12 +469,12 @@ public class Queue {
/**
* Item in a queue.
*/
@ExposedBean(defaultVisibility=999)
@ExportedBean(defaultVisibility=999)
public class Item implements Comparable<Item> {
/**
* This item can be run after this time.
*/
@Exposed
@Exported
public final Calendar timestamp;
/**
......@@ -493,7 +493,7 @@ public class Queue {
* This flag is only used in {@link Queue#getItems()} for
* 'pseudo' items that are actually not really in the queue.
*/
@Exposed
@Exported
public final boolean isBlocked;
/**
......@@ -501,7 +501,7 @@ public class Queue {
* This flag is only used in {@link Queue#getItems()} for
* 'pseudo' items that are actually not really in the queue.
*/
@Exposed
@Exported
public final boolean isBuildable;
public Item(Calendar timestamp, AbstractProject project) {
......@@ -521,7 +521,7 @@ public class Queue {
/**
* Gets a human-readable status message describing why it's in the queu.
*/
@Exposed
@Exported
public String getWhy() {
if(isBuildable) {
Node node = project.getAssignedNode();
......
......@@ -2,17 +2,16 @@ package hudson.model;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.basic.AbstractBasicConverter;
import org.kohsuke.stapler.export.CustomExportedBean;
import java.io.Serializable;
import org.kohsuke.stapler.export.CustomExposureBean;
/**
* The build outcome.
*
* @author Kohsuke Kawaguchi
*/
public final class Result implements Serializable, CustomExposureBean {
public final class Result implements Serializable, CustomExportedBean {
/**
* The build didn't have any fatal errors not errors.
*/
......@@ -77,7 +76,7 @@ public final class Result implements Serializable, CustomExposureBean {
return FAILURE;
}
public String toExposedObject() {
public String toExportedObject() {
return name;
}
......
......@@ -8,8 +8,8 @@ import hudson.FilePath;
import hudson.Util;
import static hudson.Util.combine;
import hudson.XmlFile;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import hudson.tasks.BuildStep;
import hudson.tasks.LogRotator;
import hudson.tasks.test.AbstractTestResultAction;
......@@ -47,7 +47,7 @@ import java.util.logging.Logger;
*
* @author Kohsuke Kawaguchi
*/
@ExposedBean
@ExportedBean
public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT>>
extends Actionable implements ExtensionPoint, Comparable<RunT> {
......@@ -161,7 +161,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
* When a build is {@link #isBuilding() in progress}, this method
* may return null or a temporary intermediate result.
*/
@Exposed
@Exported
public Result getResult() {
return result;
}
......@@ -197,7 +197,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
/**
* Returns true if the build is not completed yet.
*/
@Exposed
@Exported
public boolean isBuilding() {
return state!=State.COMPLETED;
}
......@@ -221,7 +221,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
*
* This is used as a signal to the {@link LogRotator}.
*/
@Exposed
@Exported
public final boolean isKeepLog() {
return getWhyKeepLog()!=null;
}
......@@ -246,12 +246,12 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
/**
* When the build is scheduled.
*/
@Exposed
@Exported
public Calendar getTimestamp() {
return timestamp;
}
@Exposed
@Exported
public String getDescription() {
return description;
}
......@@ -309,7 +309,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
/**
* Gets the millisecond it took to build.
*/
@Exposed
@Exported
public long getDuration() {
return duration;
}
......@@ -348,7 +348,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
return "#"+number;
}
@Exposed(visibility=2)
@Exported(visibility=2)
public int getNumber() {
return number;
}
......@@ -387,7 +387,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
return project.getUrl()+getNumber()+'/';
}
@Exposed(visibility=2,name="url")
@Exported(visibility=2,name="url")
public final String getAbsoluteUrl() {
return project.getAbsoluteUrl()+getNumber()+'/';
}
......
......@@ -4,8 +4,8 @@ import com.thoughtworks.xstream.XStream;
import hudson.CopyOnWrite;
import hudson.FeedAdapter;
import hudson.XmlFile;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.export.Exported;
import hudson.model.Descriptor.FormException;
import hudson.scm.ChangeLogSet;
import hudson.util.RunList;
......@@ -31,7 +31,7 @@ import java.util.logging.Logger;
*
* @author Kohsuke Kawaguchi
*/
@ExposedBean
@ExportedBean
public class User extends AbstractModelObject {
private transient final String id;
......@@ -74,7 +74,7 @@ public class User extends AbstractModelObject {
p.setUser(this);
}
@Exposed
@Exported
public String getId() {
return id;
}
......@@ -86,7 +86,7 @@ public class User extends AbstractModelObject {
/**
* The URL of the user page.
*/
@Exposed(visibility=999)
@Exported(visibility=999)
public String getAbsoluteUrl() {
return Stapler.getCurrentRequest().getRootPath()+'/'+getUrl();
}
......@@ -98,12 +98,12 @@ public class User extends AbstractModelObject {
* @return
* never null.
*/
@Exposed(visibility=999)
@Exported(visibility=999)
public String getFullName() {
return fullName;
}
@Exposed
@Exported
public String getDescription() {
return description;
}
......
package hudson.model;
import hudson.Util;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.ExportedBean;
import hudson.scm.ChangeLogSet.Entry;
import hudson.util.RunList;
import org.kohsuke.stapler.StaplerRequest;
......@@ -25,7 +25,7 @@ import java.util.Map;
*
* @author Kohsuke Kawaguchi
*/
@ExposedBean
@ExportedBean
public abstract class View extends AbstractModelObject {
/**
......
......@@ -4,8 +4,8 @@ import hudson.model.AbstractBuild;
import hudson.model.User;
import hudson.scm.CVSChangeLogSet.CVSChangeLog;
import hudson.util.IOException2;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import org.apache.commons.digester.Digester;
import org.xml.sax.SAXException;
......@@ -127,7 +127,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
f.parent = this;
}
@Exposed
@Exported
public String getDate() {
return date;
}
......@@ -136,7 +136,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.date = date;
}
@Exposed
@Exported
public String getTime() {
return time;
}
......@@ -145,7 +145,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.time = time;
}
@Exposed
@Exported
public User getAuthor() {
return author;
}
......@@ -166,12 +166,12 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.author = User.get(author);
}
@Exposed
@Exported
public String getUser() {// digester wants read/write property, even though it never reads. Duh.
return author.getDisplayName();
}
@Exposed
@Exported
public String getMsg() {
return msg;
}
......@@ -185,13 +185,13 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
files.add(f);
}
@Exposed
@Exported
public List<File> getFiles() {
return files;
}
}
@ExposedBean
@ExportedBean
public static class File {
private String name;
private String fullName;
......@@ -207,7 +207,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
* <p>
* The path is relative to the workspace root.
*/
@Exposed
@Exported
public String getName() {
return name;
}
......@@ -220,7 +220,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
* Unlike {@link #getName()}, this method returns
* a full name from the root of the CVS repository.
*/
@Exposed
@Exported
public String getFullName() {
if(fullName==null) {
// Hudson < 1.91 doesn't record full path name for CVS,
......@@ -261,7 +261,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.name = name;
}
@Exposed
@Exported
public String getRevision() {
return revision;
}
......@@ -270,7 +270,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.revision = revision;
}
@Exposed
@Exported
public String getPrevrevision() {
return prevrevision;
}
......@@ -279,7 +279,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.prevrevision = prevrevision;
}
@Exposed
@Exported
public boolean isDead() {
return dead;
}
......@@ -288,7 +288,7 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
this.dead = true;
}
@Exposed
@Exported
public EditType getEditType() {
// see issue #73. Can't do much better right now
if(dead)
......
......@@ -2,8 +2,8 @@ package hudson.scm;
import hudson.MarkupText;
import hudson.Util;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import hudson.model.AbstractBuild;
import hudson.model.User;
......@@ -20,7 +20,7 @@ import java.util.List;
*
* @author Kohsuke Kawaguchi
*/
@ExposedBean(defaultVisibility=999)
@ExportedBean(defaultVisibility=999)
public abstract class ChangeLogSet<T extends ChangeLogSet.Entry> implements Iterable<T> {
/**
......@@ -41,7 +41,7 @@ public abstract class ChangeLogSet<T extends ChangeLogSet.Entry> implements Iter
* All changes in the change set.
*/
// method for the remote API.
@Exposed
@Exported
public final Object[] getItems() {
List<T> r = new ArrayList<T>();
for (T t : this)
......@@ -56,7 +56,7 @@ public abstract class ChangeLogSet<T extends ChangeLogSet.Entry> implements Iter
return new CVSChangeLogSet(build,Collections.<CVSChangeLogSet.CVSChangeLog>emptyList());
}
@ExposedBean(defaultVisibility=999)
@ExportedBean(defaultVisibility=999)
public static abstract class Entry {
private ChangeLogSet parent;
......
package hudson.scm;
import org.kohsuke.stapler.export.CustomExposureBean;
import org.kohsuke.stapler.export.CustomExportedBean;
/**
* Designates the SCM operation.
*
* @author Kohsuke Kawaguchi
*/
public final class EditType implements CustomExposureBean {
public final class EditType implements CustomExportedBean {
private String name;
private String description;
......@@ -24,7 +24,7 @@ public final class EditType implements CustomExposureBean {
return description;
}
public String toExposedObject() {
public String toExportedObject() {
return name;
}
......
......@@ -3,8 +3,8 @@ package hudson.scm;
import hudson.model.AbstractBuild;
import hudson.model.User;
import hudson.scm.SubversionChangeLogSet.LogEntry;
import org.kohsuke.stapler.export.Exposed;
import org.kohsuke.stapler.export.ExposedBean;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import java.io.IOException;
import java.util.ArrayList;
......@@ -81,7 +81,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
* If the commit made the repository revision 1532, this
* method returns 1532.
*/
@Exposed
@Exported
public int getRevision() {
return revision;
}
......@@ -111,12 +111,12 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
this.author = User.get(author);
}
@Exposed
@Exported
public String getUser() {// digester wants read/write property, even though it never reads. Duh.
return author.getDisplayName();
}
@Exposed
@Exported
public String getDate() {
return date;
}
......@@ -125,7 +125,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
this.date = date;
}
@Override @Exposed
@Override @Exported
public String getMsg() {
return msg;
}
......@@ -144,7 +144,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
* @return
* can be empty but never null.
*/
@Exposed
@Exported
public List<Path> getPaths() {
return paths;
}
......@@ -156,7 +156,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
* Setter methods are public only so that the objects can be constructed from Digester.
* So please consider this object read-only.
*/
@ExposedBean(defaultVisibility=999)
@ExportedBean(defaultVisibility=999)
public static class Path {
private LogEntry entry;
private char action;
......@@ -176,7 +176,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
/**
* Path in the repository. Such as <tt>/test/trunk/foo.c</tt>
*/
@Exposed(name="file")
@Exported(name="file")
public String getValue() {
return value;
}
......@@ -185,7 +185,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
this.value = value;
}
@Exposed
@Exported
public EditType getEditType() {
if( action=='A' )
return EditType.ADD;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册