Moving api package to sandbox, cleaning up retrotranslator so it can be executed by CI,

removing unnecessary backport directory

WW-1700 WW-2258



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604603 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald J. Brown
2007-12-16 10:56:47 +00:00
parent 30ca710ee5
commit 918a89ce7d
31 changed files with 26 additions and 2641 deletions
-103
View File
@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* 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.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<packaging>jar</packaging>
<name>Struts 2 API</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/api/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/api/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/api/</url>
</scm>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<!-- has to be compile for StrutsTestCase, which is part of the base package so others can write unit tests -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
<version>2.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
<goals>
<goal>translate-project</goal>
</goals>
<configuration>
<classifier>backport</classifier>
<attach>true</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<showPackage>false</showPackage>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,65 +0,0 @@
/*
* $Id$
*
* 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.struts2;
/**
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
* not specify a method name, Struts defaults to {@code execute()}.
*
* <p>For example:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction <b>implements Action</b> {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* <p>is equivalent to:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Action {
/**
* Executes this action.
*
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
* ResultNames} for common suggestions.
*/
String execute();
}
@@ -1,61 +0,0 @@
/*
* $Id$
*
* 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.struts2;
/**
* Implemented by actions which may need to record errors or messages.
*
* <pre>
* static import ResultNames.*;
*
* public class SetName implements MessageAware {
*
* Messages messages;
* String name;
*
* public String execute() {
* return SUCCESS;
* }
*
* public void setName(String name) {
* if ("".equals(name))
* messages.forField("name").addError("name.required");
*
* this.name = name;
* }
*
* public void setMessages(Messages messages) {
* this.messages = messages;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface MessageAware {
/**
* Sets messages.
*
* @param messages messages
*/
void setMessages(Messages messages);
}
@@ -1,216 +0,0 @@
/*
* $Id$
*
* 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.struts2;
import java.util.List;
import java.util.Set;
import java.util.Map;
/**
* Collection of messages. Supports nesting messages by field name.
*
* <p>Uses keys when adding instead of actual messages to decouple code from messages.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Messages {
// TODO: Use Object[] for args instead of String[].
/**
* Message severity.
*/
public enum Severity {
/**
* Informational messages.
*/
INFO,
/**
* Warning messages.
*/
WARN,
/**
* Error messages.
*/
ERROR,
}
/**
* Gets nested messages for the given field.
*
* <p>Supports dot notation to represent nesting. For example:
*
* <pre>
* messages.forField("foo").forField("bar") == messages.forField("foo.bar")
* </pre>
*
* @param fieldName name of the field
* @return nested {@code Messages} for given field name
*/
Messages forField(String fieldName);
/**
* Gets map of field name to messages for that field.
*
* @return map of field name to {@code Messages}
*/
Map<String, Messages> forFields();
/**
* Adds informational message.
*
* @param key message key
* @see Severity.INFO
*/
void addInformation(String key);
/**
* Adds informational message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.INFO
*/
void addInformation(String key, String... arguments);
/**
* Adds warning message.
*
* @param key message key
* @see Severity.WARN
*/
void addWarning(String key);
/**
* Adds warning message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.WARN
*/
void addWarning(String key, String... arguments);
/**
* Adds error message.
*
* @param key message key
* @see Severity.ERROR
*/
void addError(String key);
/**
* Adds error message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.ERROR
*/
void addError(String key, String... arguments);
/**
* Adds message.
*
* @param severity message severity
* @param key message key
*/
void add(Severity severity, String key);
/**
* Adds request-scoped message.
*
* @param severity message severity
* @param key message key
* @param arguments message arguments
*/
void add(Severity severity, String key, String... arguments);
/**
* Gets set of severities for which this {@code Messages} instance has messages. Not recursive.
*
* @return unmodifiable set of {@link Severity} sorted from least to most severe
*/
Set<Severity> getSeverities();
/**
* Gets message strings for the given severity. Not recursive.
*
* @param severity message severity
* @return unmodifiable list of messages
*/
List<String> forSeverity(Severity severity);
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getErrors();
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getWarnings();
/**
* Gets informational message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getInformation();
/**
* Returns true if this or a nested {@code Messages} instance has error messages.
*
* @see Severity.ERROR
*/
boolean hasErrors();
/**
* Returns true if this or a nested {@code Messages} instance has warning messages.
*
* @see Severity.WARN
*/
boolean hasWarnings();
/**
* Returns true if this or a nested {@code Messages} instance has informational messages.
*
* @see Severity.INFO
*/
boolean hasInformation();
/**
* Returns true if this and all nested {@code Messages} instances have no messages.
*/
boolean isEmpty();
/**
* Returns true if this and all nested {@code Messages} instances have no messages for the given severity.
*
* @param severity message severity
*/
boolean isEmpty(Severity severity);
}
@@ -1,56 +0,0 @@
/*
* $Id$
*
* 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.struts2;
/**
* Commonly used result names returned by action methods.
*
* @author crazybob@google.com (Bob Lee)
*/
public final class ResultNames {
private ResultNames() {}
/**
* The action executed successfully.
*/
public static final String SUCCESS = "success";
/**
* The action requires more input, i.e.&nbsp;a validation error occurred.
*/
public static final String INPUT = "input";
/**
* The action requires the user to log in before executing.
*/
public static final String LOGIN = "login";
/**
* The action execution failed irrecoverably.
*/
public static final String ERROR = "error";
/**
* The action executed successfully, but do not execute a result.
*/
public static final String NONE = "none";
}
@@ -1,37 +0,0 @@
/*
* $Id$
*
* 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.struts2;
import org.apache.struts2.MessageAware;
/**
* Implemented by actions which wish to execute some validation logic before their action method. Useful for
* cross-field validations.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Validatable extends MessageAware {
/**
* Validates input. Executes before action method.
*/
public void validate();
}
@@ -1,38 +0,0 @@
/*
* $Id$
*
* 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.struts2.servlet;
import java.util.Map;
/**
* Implemented by actions which need direct access to the request parameters.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ParameterAware {
/**
* Sets parameters.
*
* @param parameters map of parameter name to parameter values
*/
void setParameters(Map<String, String[]> parameters);
}
@@ -1,38 +0,0 @@
/*
* $Id$
*
* 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.struts2.servlet;
import javax.servlet.http.HttpServletRequest;
/**
* Implemented by actions which need direct access to the servlet request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletRequestAware {
/**
* Sets the servlet request.
*
* @param request servlet request.
*/
void setServletRequest(HttpServletRequest request);
}
@@ -1,38 +0,0 @@
/*
* $Id$
*
* 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.struts2.servlet;
import javax.servlet.http.HttpServletResponse;
/**
* Implemented by actions which need direct access to the servlet response.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletResponseAware {
/**
* Sets the servlet response.
*
* @param response servlet response
*/
void setServletResponse(HttpServletResponse response);
}
@@ -1,79 +0,0 @@
/*
* $Id$
*
* 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.struts2.spi;
import java.lang.reflect.Method;
/**
* Context of an action execution.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ActionContext {
/**
* Gets action instance.
*/
Object getAction();
/**
* Gets action method.
*/
Method getMethod();
/**
* Gets action name.
*/
String getActionName();
/**
* Gets the path for the action's namespace.
*/
String getNamespacePath();
/**
* Gets the {@link Result} instance for the action.
*
* @return {@link Result} instance or {@code null} if we don't have a result yet.
*/
Result getResult();
/**
* Adds a result interceptor for the action. Enables executing code before and after a result, executing an
* alternate result, etc.
*/
void addResultInterceptor(Result interceptor);
/**
* Gets context of action which chained to us.
*
* @return context of previous action or {@code null} if this is the first action in the chain
*/
ActionContext getPrevious();
/**
* Gets context of action which this action chained to.
*
* @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
* action in the chain.
*/
ActionContext getNext();
}
@@ -1,36 +0,0 @@
/*
* $Id$
*
* 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.struts2.spi;
/**
* Intercepts an action request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Interceptor {
/**
* Intercepts an action request.
*
* @param requestContext current request context
*/
String intercept(RequestContext requestContext) throws Exception;
}
@@ -1,121 +0,0 @@
/*
* $Id$
*
* 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.struts2.spi;
import org.apache.struts2.Messages;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Request context. A single request may span multiple actions with action chaining.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContext {
/**
* Gets context of the currently executing action.
*
* @return current action context
*/
ActionContext getActionContext();
/**
* Convenience method.&nbsp;Equivalent to {@code getActionContext().getAction()}.
*
* @return currently executing action
*/
Object getAction();
/**
* Gets map of request parameters.
*/
Map<String, String[]> getParameterMap();
/**
* Gets map of request attributes.
*/
Map<String, Object> getAttributeMap();
/**
* Gets map of session attributes.
*/
Map<String, Object> getSessionMap();
/**
* Gets map of application (servlet context) attributes.
*/
Map<String, Object> getApplicationMap();
/**
* Finds cookies with the given name,
*/
List<Cookie> findCookiesForName(String name);
/**
* Gets locale.
*/
Locale getLocale();
/**
* Sets locale. Stores the locale in the session for future requests.
*/
void setLocale(Locale locale);
/**
* Gets messages.
*/
Messages getMessages();
/**
* Gets the servlet request.
*/
HttpServletRequest getServletRequest();
/**
* Gets the servlet response.
*/
HttpServletResponse getServletResponse();
/**
* Gets the servlet context.
*/
ServletContext getServletContext();
/**
* Gets the value stack.
*/
ValueStack getValueStack();
/**
* Invokes the next interceptor or the action method if no more interceptors remain.
*
* @return result name
* @throws IllegalStateException if already invoked or called from the action
*/
String proceed() throws Exception;
}
@@ -1,39 +0,0 @@
/*
* $Id$
*
* 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.struts2.spi;
import org.apache.struts2.spi.RequestContext;
/**
* Implemented by actions that need access to the current {@link org.apache.struts2.spi.RequestContext}. Use
* judiciously.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContextAware {
/**
* Sets {@link org.apache.struts2.spi.RequestContext}.
*
* @param requestContext
*/
void setRequestContext(RequestContext requestContext);
}
@@ -1,38 +0,0 @@
/*
* $Id$
*
* 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.struts2.spi;
import org.apache.struts2.spi.RequestContext;
/**
* The result of an action request. Struts creates a new {@code Result} instance for each request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Result {
/**
* Executes result.
*
* @param requestContext
*/
void execute(RequestContext requestContext) throws Exception;
}
@@ -1,113 +0,0 @@
/*
* $Id$
*
* 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.struts2.spi;
/**
* A central fixture of the Struts framework, the {@code ValueStack} is a stack which contains the actions
* which have executed in addition to other objects. Users can get and set values on the stack using expressions. The
* {@code ValueStack} will search down the stack starting with the most recent objects until it finds an object to
* which the expression can apply.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ValueStack extends Iterable<Object> {
/**
* Gets the top, most recent object from the stack without changing the stack.
*
* @return the top object
*/
Object peek();
/**
* Removes the top, most recent object from the stack.
*
* @return the top object
*/
Object pop();
/**
* Pushes an object onto the stack.
*
* @param o
*/
void push(Object o);
/**
* Creates a shallow copy of this stack.
*
* @return a new stack which contains the same objects as this one
*/
ValueStack clone();
/**
* Queries the stack. Starts with the top, most recent object. If the expression can apply to the object, this
* method returns the result of evaluating the expression. If the expression does not apply, this method moves
* down the stack to the next object and repeats. Returns {@code null} if the expression doesn't apply to any
* objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack
*/
Object get(String expression);
/**
* Queries the stack and converts the result to the specified type. Starts with the top, most recent object. If
* the expression can apply to the object, this method returns the result of evaluating the expression converted
* to the specified type. If the expression does not apply, this method moves down the stack to the next object
* and repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @param asType the type to convert the result to
* @return the evaluation of the expression against the first applicable object in the stack converted to the
* specified type
*/
<T> T get(String expression, Class<T> asType);
/**
* Queries the stack and converts the result to a {@code String}. Starts with the top, most recent object. If the
* expression can apply to the object, this method returns the result of evaluating the expression converted to a
* {@code String}. If the expression does not apply, this method moves down the stack to the next object and
* repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack converted to a {@code
* String}
*/
String getString(String expression);
/**
* Sets a value on an object from the stack. This method starts at the top, most recent object. If the expression
* applies to that object, this methods sets the given value on that object using the expression and converting
* the type as necessary. If the expression does not apply, this method moves to the next object and repeats.
*
* @param expression
* @param value
*/
void set(String expression, Object value);
/**
* Returns the number of object on the stack.
*
* @return size of stack
*/
int size();
}
-174
View File
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-5
View File
@@ -1,5 +0,0 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
-28
View File
@@ -1,28 +0,0 @@
ASM: a very small and fast Java bytecode manipulation framework
Copyright (c) 2000-2005 INRIA, France Telecom
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-26
View File
@@ -1,26 +0,0 @@
Copyright (c) 2005 - 2007 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-29
View File
@@ -1,29 +0,0 @@
Retrotranslator: a Java bytecode transformer that translates Java classes
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
Copyright (c) 2005, 2006 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-22
View File
@@ -1,22 +0,0 @@
STRUTS 2 FOR JAVA 4
Struts 2 is targeted for Java 5, but a "backported" version to Java 4 is being made available,
using the RetroTranslator tool.
To use Struts 2 with Java 4 (preferably Java 1.4.2), place the enclosed Struts, XWork,
RetroTranslator, and backport-util-concurrent JARs on your classpath. For complete details on
using RetroTranslator JARs, see the RetroTranslator site.
* http://retrotranslator.sourceforge.net/
NOTE: The Struts 2 and XWork 2 JARs are complete replacements for the corresponding standard
Java 5 JARs. Do not use both sets of JARs in the same environment!
If you discover any issues using the Struts 2 for Java 4 JAR, please report them to the Struts
Dev list or JIRA ticket ww-1391.
* http://struts.apache.org/mail.html
* https://issues.apache.org/struts/browse/WW-1391
Cheers!
-174
View File
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-50
View File
@@ -1,50 +0,0 @@
/* ====================================================================
* The OpenSymphony Software License, Version 1.1
*
* (this license is derived and fully compatible with the Apache Software
* License - see http://www.apache.org/LICENSE.txt)
*
* Copyright (c) 2001-2004 The OpenSymphony Group. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* OpenSymphony Group (http://www.opensymphony.com/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "OpenSymphony" and "The OpenSymphony Group"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact license@opensymphony.com .
*
* 5. Products derived from this software may not be called "OpenSymphony"
* or "XWork", nor may "OpenSymphony" or "XWork" appear in their
* name, without prior written permission of the OpenSymphony Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
Binary file not shown.
-994
View File
@@ -1,994 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Retrotranslator</title>
</head>
<body>
<table border="0" width="98%">
<tr>
<td><h2>Retrotranslator</h2></td>
<td width="125"><a href="http://sourceforge.net"><img
src="http://sflogo.sourceforge.net/sflogo.php?group_id=153566&amp;type=2"
width="125" height="37" border="0" alt="SourceForge.net Logo"/></a>
</td>
<td width="10">&nbsp;
</td>
<td width="127"><a href="http://www.jetbrains.com/idea/"><img
src="http://www.jetbrains.com/idea/opensource/img/banners/idea125x37_white.gif"
width="127" height="37" border="0" alt="The best Java IDE"/></a>
</td>
</tr>
</table>
<h4>Contents</h4>
<ol>
<li><a href="#what">What is Retrotranslator?</a></li>
<li><a href="#features">What Java 5 features are supported?</a></li>
<li><a href="#commandline">How to use Retrotranslator from a command line?</a></li>
<li><a href="#jarfile">How to produce a JAR file compatible with J2SE 1.4?</a></li>
<li><a href="#ant">How to use Retrotranslator from Apache Ant or Maven?</a></li>
<li><a href="#idea">How to use Retrotranslator from IntelliJ IDEA?</a></li>
<li><a href="#jit">How to use Just-in-Time Retrotranslator?</a></li>
<li><a href="#supported">What API is supported on J2SE 1.4?</a></li>
<li><a href="#extension">How to write an extension?</a></li>
<li><a href="#limitations">What are the limitations?</a></li>
<li><a href="#alternative">Alternative tools</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#license">License</a></li>
</ol>
<h4><a name="what">What is Retrotranslator?</a></h4>
<p>
Retrotranslator is a tool that makes Java applications compatible with various versions of the Java platform.
It supports all Java 5 language features and a significant part of Java 5 API on J2SE 1.4. In other Java
environments only the Java 5 language features that does not require new API are supported.
Retrotranslator is based on the <a href="http://asm.objectweb.org/">ASM</a> bytecode manipulation framework and the
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">backport</a> of concurrency utilities.
</p>
<h4><a name="features">What Java 5 features are supported?</a></h4>
<ul>
<li>Generics</li>
<li>Annotations</li>
<li>Reflection on generics and annotations</li>
<li>Typesafe enums</li>
<li>Autoboxing/unboxing</li>
<li>Enhanced for loop</li>
<li>Varargs</li>
<li>Covariant return types</li>
<li>Formatted output</li>
<li>Static import</li>
<li>Concurrency utilities</li>
<li>Collections framework enhancements</li>
</ul>
<h4><a name="commandline">How to use Retrotranslator from a command line?</a></h4>
<ol>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=153566">Download</a>
and unzip the binary distribution file <code>Retrotranslator-<i>n.n.n</i>-bin.zip</code>,
where <i>n.n.n</i> is the latest Retrotranslator release number.
</li>
<li>
Compile your classes with Java 5 or later and put them into some directory, e.g. <code>myclasses</code>.
</li>
<li>
Go to the unzipped directory and execute:<br>
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar -srcdir myclasses</code>
</li>
<li>
If you use Java 5 API put <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent-<i>n.n</i>.jar</code> into the classpath of your application.
</li>
<li>
Run or debug the application as usual on J2SE 1.4.x.
</li>
</ol>
<p><a name="syntax">The command line syntax:</a><br>
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar &lt;options&gt;</code>
<br>or<br>
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar
net.sf.retrotranslator.transformer.Retrotranslator &lt;options&gt;</code></p>
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Option</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td nowrap><code>-srcdir &lt;path&gt;</code></td>
<td>The directory with the files to process (may be specified several times).</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-srcjar &lt;file&gt;</code></td>
<td>The JAR archive file with the files to process (may be specified several times).</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-destdir &lt;path&gt;</code></td>
<td>The directory to place processed files.</td>
<td>The source directory.</td>
</tr>
<tr>
<td nowrap><code>-destjar &lt;file&gt;</code></td>
<td>The JAR archive file to place processed files.</td>
<td>The source JAR file.</td>
</tr>
<tr>
<td nowrap><code>-srcmask &lt;mask&gt;</code></td>
<td>The wildcard pattern specifying the files to transform rather than copy
(classes or UTF-8 text files), e.g. <code>*.class;?*.tld</code>.
</td>
<td><code>*.class</code></td>
</tr>
<tr>
<td nowrap><a name="option_target"><code>-target &lt;version&gt;</code></a></td>
<td>The version of the JVM where classes should be able to run. The supported targets are
1.1, 1.2, 1.3, 1.4, and 1.5. While API support is available only for the 1.4 target,
user-defined <a href="#option_backport">backport</a> classes may be used for other targets as well.
</td>
<td><code>1.4</code></td>
</tr>
<tr>
<td nowrap><a name="option_classpath"><code>-classpath &lt;path&gt;</code></a></td>
<td>The dependencies of the translated classes, including the target JVM and Retrotranslator itself.
The following files should be specified among others if the target is Sun JRE 1.4: <code>rt.jar</code>,
<code>jce.jar</code>, <code>jsse.jar</code>, <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code>,
and <code>backport-util-concurrent-<i>n.n</i>.jar</code>.
This option may be omitted if the current Java environment matches the target one.
</td>
<td>The current classpath.</td>
</tr>
<tr>
<td nowrap><a name="option_verify"><code>-verify</code></a></td>
<td>Asks the translator to examine translated bytecode for references to classes, methods, or fields
that cannot be found in the <a href="#option_classpath">classpath</a>.
</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><a name="option_support"><code>-support &lt;features&gt;</code></a></td>
<td>Enables advanced features. The names specified should be separated with semicolons, e.g.
<code>ThreadLocal.remove;BigDecimal.setScale</code>.
</td>
<td>-</td>
</tr>
<tr>
<td nowrap><a name="option_advanced"><code>-advanced</code></a></td>
<td>Enables all advanced features at once, but it's recommended to enable only required features
in order to avoid compatibility issues.
</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><a name="option_smart"><code>-smart</code></a></td>
<td>Makes all backport classes inheritable provided that the <a href="#option_classpath">classpath</a>
correctly reflects the target environment.
For example, the backport of the <code>Writer.append(String)</code> method may be used
to translate the following expression: <code>new&nbsp;FileWriter("file.tmp").append("Hello")</code>.
</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><a name="option_backport"><code>-backport &lt;names&gt;</code></a></td>
<td>The <a href="#extension">backport</a> names separated with semicolons, e.g. <code>
com.myco.all;java.util:com.myco.ju;javax.net.SocketFactory:com.myco.jsse.Factory</code>.
The corresponding backport classes must be present in the <a href="#option_classpath">classpath</a>.
</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-embed &lt;package&gt;</code></td>
<td>The package name for a partial copy of <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent-<i>n.n</i>.jar</code> to be put along with translated classes.
This makes an application independent of other versions of Retrotranslator present in the classpath.
</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-lazy</code></td>
<td>Asks the translator to transform and verify only the classes compiled with a target greater than the
<a href="#option_target">current</a> one.
</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><code>-stripsign</code></td>
<td>Asks the translator to strip signature (generics) information.</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><code>-verbose</code></td>
<td>Asks the translator for verbose output.</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><code>-retainapi</code></td>
<td>Asks the translator to modify classes for JVM compatibility but keep use of API
unless the <a href="#option_backport">backport</a> option is specified.
Any references introduced by a compiler remain unchanged, like the use of
<code>java.lang.StringBuilder</code> for string concatenation or
the implicit <code>valueOf</code> method calls for autoboxing.
</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><code>-retainflags</code></td>
<td>Asks the translator to keep Java 5 specific access modifiers.</td>
<td><code>false</code></td>
</tr>
<tr>
<td nowrap><code>-uptodatecheck</code></td>
<td>Asks the translator to skip processing of files if the destination files are newer.</td>
<td><code>false</code></td>
</tr>
</table>
<h4><a name="jarfile">How to produce a JAR file compatible with J2SE 1.4?</a></h4>
<p>
If you have <code>myapplication5.jar</code> file built with Java 5 you can use the following command to produce
<code>myapplication4.jar</code>. It will be compatible with Java 1.4 and independent of Retrotranslator because
backport classes are added to the translated application with a different package name:
</p>
<p>
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar
-srcjar myapplication5.jar -destjar myapplication4.jar -embed com.mycompany.internal</code><br>
</p>
<p>
Also it is recommended to specify the <a href="#option_classpath">classpath</a> and
<a href="#option_verify">verify</a> options. In case of verification failure try the
<a href="#option_smart">smart</a> and <a href="#option_advanced">advanced</a> options.
</p>
<h4><a name="ant">How to use Retrotranslator from Apache Ant or Maven?</a></h4>
<p>The distribution contains an <a href="http://ant.apache.org/">Apache Ant</a> task
<code>net.sf.retrotranslator.transformer.RetrotranslatorTask</code>. Every <a href="#commandline">command line</a>
option can be set using the corresponding attribute. In addition the source files can be specified with nested
<code>fileset</code>, <code>jarfileset</code>, and <code>dirset</code> elements and the
<a href="#option_classpath">classpath</a> can be set with nested <code>classpath</code>
elements or the <code>classpathref</code> attribute.
The source directories specified with <code>srcdir</code>, <code>dirset</code>,
and the <code>dir</code> attribute of <code>fileset</code> should contain the root package of the classes.
In case of warnings the build fails unless the value of
the <code>failonwarning</code> attribute is set to <code>false</code>. For example:
</p>
<pre>
&lt;path id="classpath"&gt;
&lt;fileset dir="lib" includes="**/*.jar"/&gt;
&lt;/path&gt;
&lt;taskdef name="retrotranslator" classpathref="classpath"
classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" /&gt;
&lt;retrotranslator destdir="build/classes14" verify="true" failonwarning="false"&gt;
&lt;fileset dir="build/classes15" includes="**/*.class"&gt;
&lt;jarfileset dir="build/lib15" includes="**/*.jar"&gt;
&lt;classpath location="${java14_home}/jre/lib/rt.jar"/&gt;
&lt;classpath refid="classpath"/&gt;
&lt;/retrotranslator&gt;
</pre>
<p>
For <a href="http://maven.apache.org/">Maven</a> there is a
<a href="http://mojo.codehaus.org/retrotranslator-maven-plugin/">Retrotranslator plugin</a>
from the <a href="http://mojo.codehaus.org/">Mojo Project</a>.
</p>
<h4><a name="idea">How to use Retrotranslator from IntelliJ IDEA?</a></h4>
<p>
There is a <a href="http://plugins.intellij.net/plugin/?id=145">plugin</a> to automatically translate and verify
classes compiled by <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a>, so you can develop in Java 5 but
run and debug on JRE 1.4.
</p>
<h4><a name="jit">How to use Just-in-Time Retrotranslator?</a></h4>
<p>
In order to run a Java 5 application on J2SE 1.4 start it with JIT Retrotranslator:
</p>
<ul>
<li>
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar
net.sf.retrotranslator.transformer.JITRetrotranslator
&lt;options&gt; -jar &lt;jarfile&gt; [&lt;args...&gt;]</code>
</li>
<li>
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar:&lt;classpath&gt;
net.sf.retrotranslator.transformer.JITRetrotranslator
&lt;options&gt; &lt;class&gt; [&lt;args...&gt;]</code>
</li>
</ul>
<p>
The options can include <code><a href="#option_support">support</a></code>,
<code><a href="#option_advanced">advanced</a></code>, <code><a href="#option_smart">smart</a></code>, and
<code><a href="#option_backport">backport</a></code>. When running on J2SE 5.0 JIT Retrotranslator simply calls
the application, but on J2SE 1.4 it also translates classes compiled for Java 5 or later. However this capability
depends on the current JVM and the application itself, so under certain conditions JIT Retrotranslator may be unable
to translate either a JAR file or classes from the classpath or both.
</p>
<h4><a name="supported">What API is supported on J2SE 1.4?</a></h4>
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Package</th>
<th>Class</th>
<th>Methods and fields</th>
<th>Compatibility notes</th>
</tr>
<tr>
<td rowspan="6"><code>java.io</code></td>
<td><code>Closeable<sup><a href="#2">2</a></sup></code>
</td>
<td>* (all methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Flushable<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>PrintStream</code></td>
<td>
* (11 new methods and constructors)
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>PrintWriter</code></td>
<td>
* (11 new methods and constructors)
</td>
<td>
The <code>PrintWriter.format</code> and <code>PrintWriter.printf</code> methods always flush the output buffer.
</td>
</tr>
<tr>
<td><code>Reader</code></td>
<td>* (1 new method)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Writer</code></td>
<td>* (3 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="28"><code>java.lang</code></td>
<td><code>Appendable<sup><a href="#2">2</a></sup></code></td>
<td>*
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Boolean</code></td>
<td>* (2 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Byte</code></td>
<td>* (1 new method)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Character</code></td>
<td>* (44 new methods)</td>
<td>New members of <code>Character.UnicodeBlock</code> are not supported.
All supplementary code points are considered as unassigned.
</td>
</tr>
<tr>
<td><code>Class</code></td>
<td>* (21 new methods)</td>
<td>
Enable features "<code>Class.getMethod</code>" and "<code>Class.getDeclaredMethod</code>" for more
uniform support of generics and covariant return types on different platforms<sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>Deprecated</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Double</code></td>
<td><code>valueOf(double)</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Enum</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Float</code></td>
<td><code>valueOf(float)</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>IllegalArgumentException</code></td>
<td>* (2 new constructors)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>IllegalStateException</code></td>
<td>* (2 new constructors)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Integer</code></td>
<td><code>valueOf(int),<br>signum(int)</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Iterable<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Long</code></td>
<td><code>valueOf(long),<br>signum(long)</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Package</code></td>
<td>* (4 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Readable<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Short</code></td>
<td>* (2 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>StackTraceElement</code></td>
<td>* (1 new constructor)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>String</code></td>
<td>* (10 new methods and constructors)<br><code>
isEmpty()<sup><a href="#4">4</a></sup>
</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>StringBuffer</code></td>
<td>* (11 new methods and constructors)</td>
<td>
Enable feature "<code>StringBuffer.trimToSize</code>" to use an empty implementation of
the <code>StringBuffer.trimToSize()</code> method<sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>StringBuilder</code></td>
<td>*</td>
<td><code>StringBuilder</code> is replaced with <code>StringBuffer</code>.</td>
</tr>
<tr>
<td><code>SuppressWarnings</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>System</code></td>
<td><code>nanoTime()<sup><a href="#1">1</a></sup>,<br> clearProperty(String)</code></td>
<td>
The <code>System.nanoTime()</code> method precision
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/doc/api/edu/emory/mathcs/backport/java/util/concurrent/helpers/Utils.html#nanoTime()">
may vary</a> on different platforms.
</td>
</tr>
<tr>
<td><code>Thread</code></td>
<td>* (8 new methods)</td>
<td>
The <code>Thread.getId()</code> method does not reflect the order in which threads are created.<br>
The <code>Thread.getStackTrace()</code> and <code>Thread.getAllStackTraces()</code>
methods return non-empty stack trace only for the current thread.<br>
Enable feature "<code>Thread.getState</code>" to support the <code>Thread.getState()</code> method, but it may
be able
to detect only <code>NEW</code>, <code>RUNNABLE</code> and <code>TERMINATED</code> states.<sup><a
href="#3">3</a></sup><br>
Enable features "<code>Thread.setUncaughtExceptionHandler</code>" and
"<code>Thread.setDefaultUncaughtExceptionHandler</code>" to support exception handlers for threads
created by translated code (in contrast to J2SE 5.0 the default <code>UncaughtExceptionHandler</code>
takes precedence over <code>ThreadGroup</code>)<sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>Thread.State</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Thread.UncaughtExceptionHandler<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>ThreadLocal</code></td>
<td>* (1 new method)</td>
<td>Enable feature "<code>ThreadLocal.remove</code>" to use alternative <code>ThreadLocal</code>
and <code>InheritableThreadLocal</code> implementations with method
<code>remove()</code><sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>TypeNotPresentException</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>java.lang.annotation</code></td>
<td>* (all classes)</td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>java.lang.instrument</code></td>
<td>*</td>
<td>*</td>
<td>
Bytecode instrumentation is not implemented.
</td>
</tr>
<tr>
<td><code>java.lang.management</code></td>
<td><code>ManagementFactory</code></td>
<td>
<code>getPlatformMBeanServer()</code></td>
<td>
The <code>ManagementFactory.getPlatformMBeanServer()</code> method simply returns
the first registered <code>MBeanServer</code> or creates it when no one exists.
An implementation of JMX 1.2 must be present in a classpath.
</td>
</tr>
<tr>
<td rowspan="2"><code>java.lang.ref</code></td>
<td><code>SoftReference</code></td>
<td>*</td>
<td>
Enable feature "<code>SoftReference.NullReferenceQueue</code>" to
support <code>null</code> for the second parameter of
<code>SoftReference(Object,ReferenceQueue)</code>
on all platforms<sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>WeakReference</code></td>
<td>*</td>
<td>
Enable feature "<code>WeakReference.NullReferenceQueue</code>" to
support <code>null</code> for the second parameter of
<code>WeakReference(Object,ReferenceQueue)</code>
on all platforms<sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td rowspan="13"><code>java.lang.reflect</code></td>
<td><code>AccessibleObject</code></td>
<td>* (4 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>AnnotatedElement<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Constructor</code></td>
<td>* (11 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Field</code></td>
<td>* (8 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>GenericArrayType</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>GenericDeclaration<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>GenericSignatureFormatError</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>MalformedParameterizedTypeException</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Method</code></td>
<td>* (14 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>ParameterizedType</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Type<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>TypeVariable</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>WildcardType</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2"><code>java.math</code></td>
<td><code>BigDecimal</code></td>
<td>
<code>ZERO, ONE, TEN,<br>
BigDecimal(int),<br>
BigDecimal(long),<br>
BigDecimal(char[]),<br>
BigDecimal(char[], int, int),<br>
divideAndRemainder(BigDecimal),<br>
divideToIntegralValue(BigDecimal),<br>
pow(int),<br>
remainder(BigDecimal),<br>
toPlainString(),<br>
valueOf(double),<br>
valueOf(long)</code></td>
<td>
Enable feature "<code>BigDecimal.setScale</code>" to support negative scales in method
<code>BigDecimal.setScale(int, int)</code><sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>BigInteger</code></td>
<td><code>TEN</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="5"><code>java.net</code></td>
<td><code>HttpURLConnection</code></td>
<td>* (6 new methods)</td>
<td>
Enable features "<code>HttpURLConnection.setChunkedStreamingMode</code>",
"<code>HttpURLConnection.setFixedLengthStreamingMode</code>"
to use the corresponding methods, but on Java 1.4 they will simply return.
Consider using alternative or writing own protocol handlers.
</td>
</tr>
<tr>
<td><code>Proxy</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>ProxySelector</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>URL</code></td>
<td>* (2 new methods)</td>
<td>The <code>Proxy</code> is ignored by the
<code>URL.openConnection(Proxy)</code> method.
</td>
</tr>
<tr>
<td><code>URLConnection</code></td>
<td>* (4 new methods)</td>
<td>
Enable features "<code>URLConnection.getConnectTimeout</code>", "<code>URLConnection.setConnectTimeout</code>",
"<code>URLConnection.getReadTimeout</code>", "<code>URLConnection.setReadTimeout</code>"
to use the corresponding methods, but on Java 1.4 they will simply return.
Consider using alternative or writing own protocol handlers.
</td>
</tr>
<tr>
<td rowspan="2"><code>java.nio</code></td>
<td><code>CharBuffer</code></td>
<td>* (4 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Charset</code></td>
<td>* (1 new method)</td>
<td>The <code>Charset.defaultCharset()</code> method returns UTF-8
if the default charset is unavailable (occurs on JDK 1.4.0).
</td>
</tr>
<tr>
<td><code>java.rmi.server</code></td>
<td><code>RemoteObjectInvocationHandler</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>java.text</code></td>
<td><code>DecimalFormat</code></td>
<td>* (2 new methods)</td>
<td>
Enable feature "<code>DecimalFormat.setParseBigDecimal</code>" to support the
<code>DecimalFormat.setParseBigDecimal(boolean)</code> method, but
parsing and formatting precision will still be limited by the <code>java.lang.Double</code>
or <code>java.lang.Long</code> precision<sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td rowspan="14"><code>java.util</code></td>
<td><code>AbstractQueue<sup><a href="#1">1</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>ArrayDeque<sup><a href="#1">1</a>,<a href="#4">4</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Arrays</code></td>
<td>* (21 new methods)<br>
<code>copyOf(...)</code><sup><a href="#4">4</a></sup> (10 methods)<br>
<code>copyOfRange(...)</code><sup><a href="#4">4</a></sup> (10 methods)
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Collections<sup><a href="#1">1</a></sup></code></td>
<td>* (13 new methods)<br>
<code>newSetFromMap(Map)</code><sup><a href="#4">4</a></sup>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Deque<sup><a href="#1">1</a>,<a href="#2">2</a>,<a href="#4">4</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>EnumMap</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>EnumSet</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Formatter</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>LinkedList</code></td>
<td>* (5 new methods)</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>PriorityQueue<sup><a href="#1">1</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Properties</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Queue<sup><a href="#1">1</a>,<a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Timer</code></td>
<td>* (3 new methods and constructors)</td>
<td>
Enable feature "<code>Timer.All</code>" to use alternative <code>Timer</code>
and <code>TimerTask</code> implementations in order to be able to call <code>Timer(String)</code>,
<code>Timer(String, boolean)</code>, and <code>Timer.purge()</code><sup><a href="#3">3</a></sup>.
</td>
</tr>
<tr>
<td><code>UUID</code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>java.util.concurrent,<br>java.util.concurrent.atomic,<br>java.util.concurrent.locks</code></td>
<td>almost all classes<sup><a href="#1">1</a></sup></td>
<td>almost all methods</td>
<td>The <code>LockSupport</code> class may be unusable due to insufficient performance.
The <code>Condition.awaitNanos(long)</code> method has
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/doc/api/edu/emory/mathcs/backport/java/util/concurrent/helpers/Utils.html#awaitNanos(edu.emory.mathcs.backport.java.util.concurrent.locks.Condition, long)">
little</a> accuracy guarantees.
</td>
</tr>
<tr>
<td rowspan="3"><code>java.util.regex</code></td>
<td><code>Matcher</code></td>
<td>
<code>quoteReplacement(String),<br> toMatchResult()</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>MatchResult<sup><a href="#2">2</a></sup></code></td>
<td>*</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>Pattern</code></td>
<td><code>quote(String)</code></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><code>javax.net.ssl</code></td>
<td><code>HttpsURLConnection</code></td>
<td> * (2 new methods)</td>
<td>&nbsp;</td>
</tr>
</table>
<p>
<a name="1"><sup>1</sup></a> Supported via the
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a>.<br>
<a name="2"><sup>2</sup></a> In most cases this type is replaced with its base type.<br>
<a name="3"><sup>3</sup></a> Supported only when the corresponding feature is enabled via the
<code><a href="#option_support">support</a></code> or
<code><a href="#option_advanced">advanced</a></code> options.<br>
<a name="4"><sup>4</sup></a> Introduced in Java 6.<br>
</p>
<h4><a name="extension">How to write an extension?</a></h4>
<p>
In order to support API unavailable on the target platform Retrotranslator should be able to replace all references
to new clases, constructors, methods, and fields with references to backports compatible with the platform.
The location of the backports must be specified with the <a href="#option_classpath">classpath</a> option. The
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/registry/backport14.properties?view=markup">default</a>
backports for the 1.4 target have been packaged into the <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent-<i>n.n</i>.jar</code> files, and to complement or override them additional backport
names may be specified via the <a href="#option_backport">backport</a> option. The backport names may have five
different forms, the first one declares a universal backport package and the others allow to reuse existing backports.
</p>
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Backport name form</th>
<th>Example</th>
</tr>
<tr>
<td><code>&lt;universal backport package name&gt;</code></td>
<td><code>net.sf.retrotranslator.runtime<br>
com.mycompany.backport</code></td>
</tr>
<tr>
<td><code>&lt;original package name&gt;:&lt;backport package name&gt;</code></td>
<td><code>java.util.concurrent:edu.emory.mathcs.backport.java.util.concurrent<br>
com.sun.org.apache.xerces.internal:org.apache.xerces</code></td>
</tr>
<tr>
<td><code>&lt;original class name&gt;:&lt;backport class name&gt;</code></td>
<td><code>java.lang.StringBuilder:java.lang.StringBuffer<br>
java.util.LinkedHashMap:org.apache.commons.collections.map.LinkedMap</code></td>
</tr>
<tr>
<td><code>&lt;original method name&gt;:&lt;backport method name&gt;</code></td>
<td><code>java.lang.System.nanoTime:edu.emory.mathcs.backport.java.util.concurrent.helpers.Utils.nanoTime</code></td>
</tr>
<tr>
<td><code>&lt;original field name&gt;:&lt;backport field name&gt;</code></td>
<td><code>java.util.Collections.EMPTY_MAP:edu.emory.mathcs.backport.java.util.Collections.EMPTY_MAP</code></td>
</tr>
</table>
<p>
The names of backport classes in a universal backport package consist of the backport package name,
the name of the original class, and an optional trailing underscore. For example,
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/util/EnumSet_.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.util.EnumSet<b>_</b></code></a> is a complete backport of
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/EnumSet.html"><code>java.util.EnumSet</code></a>.
But when classes exist on the target platform then the backports of their new fields, constructors and methods are
grouped into classes with a leading underscore in their names. Look at the
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/math/_BigDecimal.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.math.<b>_</b>BigDecimal</code></a> class:
</p>
<ul>
<li>For a static field there is a public static field with the same name and type.</li>
<li>For a static method there is a public static method with the same signature.</li>
<li>For an instance method there is a public static method with the same signature
but with an additional first parameter representing the instance.
</li>
<li>For a constructor there is a public static <code>convertConstructorArguments</code> method that
accepts constructor's arguments an returns an argument for a Java 1.4 constuctor.
</li>
</ul>
<p>
The <a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/io/_PrintStream.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.io.<b>_</b>PrintStream</code></a> and
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/lang/_SecurityException.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.lang.<b>_</b>SecurityException</code></a> classes use another type of
constructor backports. There is a public static
<code>createInstanceBuilder</code> method that accepts constructor's arguments an returns an object with public
<code>argument1</code>...<code>argumentN</code> methods and an optional public void <code>initialize</code> method.
All the <code>argumentX</code> methods provide arguments for a Java 1.4 constuctor and should not have any
parameters. The <code>initialize</code> method has a single parameter for the created instance and may be used for
postprocessing. If this approach does not work there is another flexible but not always supported one used by
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/lang/_StackTraceElement.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.lang.<b>_</b>StackTraceElement</code></a>.
If backported methods require access to non-public methods or fields of the instance, they can do it with reflection
when the security manager allows such access. The backports of public instance fields are not supported, but private
instance fields can be emulated using a weak identity map, see
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/lang/_Thread.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.lang.<b>_</b>Thread</code></a> for an example.
</p>
<h4><a name="limitations">What are the limitations?</a></h4>
<ul>
<li>Retrotranslator does not emulate the Java 5 memory model.</li>
<li>Only the classes, methods, and fields listed <a href="#supported">above</a> should work
and the other features, like formatted input, are not supported.
</li>
<li>Java 5 reflection methods should be able to load compiled classes as resources,
so for dynamically generated classes they may return incomplete information.
</li>
<li>The backported implementation of Java 5 API may be incompatible
with the original API implementation when running on J2SE 5.0.
</li>
<li>Reflection-based tools may be unable to discover Java 5 API when running on J2SE 1.4.</li>
<li>The constants inlined by a compiler and access modifiers are ignored during the verification.</li>
</ul>
<h4><a name="alternative">Alternative tools</a></h4>
<ul>
<li><a href="http://retroweaver.sourceforge.net/">Retroweaver</a></li>
<li><a href="http://tinyurl.com/r8xba">Declawer</a></li>
<li><a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossRetro">JBossRetro</a></li>
</ul>
<h4><a name="contact">Contact</a></h4>
<ul>
<li><a href="http://sourceforge.net/projects/retrotranslator">Project summary</a></li>
<li><a href="http://retrotranslator.sourceforge.net/">Latest documentation</a></li>
<li><a href="http://sourceforge.net/forum/forum.php?forum_id=513539">Open discussion</a></li>
<li><a href="http://sourceforge.net/forum/forum.php?forum_id=513540">Help</a></li>
<li><a href="http://sourceforge.net/tracker/?group_id=153566&atid=788279">Bugs</a></li>
<li><a href="http://sourceforge.net/tracker/?group_id=153566&atid=788282">Feature requests</a></li>
<li><a href="http://sourceforge.net/users/tarasp/">Author</a></li>
</ul>
<h4><a name="license">License</a></h4>
<pre>
Copyright (c) 2005 - 2007 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
</pre>
</body>
</html>
Binary file not shown.
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-core-2.1.1-SNAPSHOT.jar -destjar struts2-core-backport-2.1.1-SNAPSHOT.jar
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-api-2.1.1-SNAPSHOT.jar -destjar struts2-api-backport-2.1.1-SNAPSHOT.jar
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/xwork-2.1.1-SNAPSHOT.jar -destjar xwork-backport-2.1.1-SNAPSHOT.jar
-23
View File
@@ -150,29 +150,6 @@
</reporting>
<profiles>
<profile>
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
<goals>
<goal>translate-project</goal>
</goals>
<configuration>
<classifier>backport</classifier>
<attach>true</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>alljars</id>
<build>
-26
View File
@@ -87,32 +87,6 @@
</dependencies>
<profiles>
<profile>
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
<goals>
<goal>translate-project</goal>
</goals>
<configuration>
<classifier>backport</classifier>
<attach>true</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
+26 -9
View File
@@ -86,7 +86,6 @@
<modules>
<module>core</module>
<!--<module>assembly</module>-->
<module>api</module>
</modules>
<licenses>
@@ -141,15 +140,33 @@
</modules>
</profile>
<profile>
<id>1.4-backport</id>
<activation>
<jdk>1.4</jdk>
</activation>
<dependencies>
<!-- should have the org.w3c.dom dependency here -->
</dependencies>
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>translate-project</goal>
</goals>
<configuration>
<verify>false</verify>
<failonwarning>true</failonwarning>
<lazy>true</lazy>
<advanced>true</advanced>
<verbose>false</verbose>
<destdir>${project.build.directory}/classes-retro</destdir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>alljars</id>
<build>