本文整理汇总了Java中org.springframework.core.JdkVersion.isAtLeastJava15方法的典型用法代码示例。如果您正苦于以下问题:Java JdkVersion.isAtLeastJava15方法的具体用法?Java JdkVersion.isAtLeastJava15怎么用?Java JdkVersion.isAtLeastJava15使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.core.JdkVersion
的用法示例。
在下文中一共展示了JdkVersion.isAtLeastJava15方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMapValue
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
private Object getMapValue(Map map, Object key) {
if (map.containsKey(key)) {
return map.get(key);
}
else {
if (!JdkVersion.isAtLeastJava15()) {
// we don't know the type of the keys, so we fall back to
// comparing toString()
for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
if (entry.getKey() == key
|| (entry.getKey() != null && key != null && entry.getKey().toString().equals(
key.toString()))) {
return entry.getValue();
}
}
}
return null;
}
}
示例2: computeSecurityAttribute
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
private SecurityAttribute computeSecurityAttribute(Method method, Class<?> targetClass)
{
// The method may be on an interface, but we need attributes from the
// target class.
// If the target class is null, the method will be unchanged.
Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass);
// If we are dealing with method with generic parameters, find the
// original method.
if( JdkVersion.isAtLeastJava15() )
{
specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
}
// First try is the method in the target class.
SecurityAttribute txAtt = findSecurityAttribute(specificMethod, targetClass);
if( txAtt != null )
{
return txAtt;
}
if( !specificMethod.equals(method) )
{
// Fallback is to look at the original method.
txAtt = findSecurityAttribute(method, targetClass);
if( txAtt != null )
{
return txAtt;
}
}
return null;
}
示例3: getTestBundlesNames
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*
* <p/>Installs the required web bundles (such as Apache Tomcat) before
* running the integration test.
*/
protected String[] getTestBundlesNames() {
List col = new ArrayList();
// Servlet/JSP artifacts
col.add("javax.servlet, com.springsource.javax.servlet, 2.4.0");
col.add(SPRING_OSGI_GROUP + ", jsp-api.osgi, 2.0-SNAPSHOT");
// JSP compiler
col.add(SPRING_OSGI_GROUP + ", jasper.osgi, 5.5.23-SNAPSHOT");
col.add(SPRING_OSGI_GROUP + ", commons-el.osgi, 1.0-SNAPSHOT");
// standard tag library
col.add("org.springframework.osgi, jstl.osgi, 1.1.2-SNAPSHOT");
// add MX4J for 1.4
// if < jdk 1.5, add an JMX implementation
if (!JdkVersion.isAtLeastJava15())
col.add("net.sourceforge.mx4j, com.springsource.mx4j, 3.0.2");
col.add(SPRING_OSGI_GROUP + ", catalina.osgi, 5.5.23-SNAPSHOT");
col.add(SPRING_OSGI_GROUP + ", catalina.start.osgi, 1.0.0");
// Spring DM web extender
col.add(SPRING_OSGI_GROUP + ", spring-osgi-web," + getSpringDMVersion());
col.add(SPRING_OSGI_GROUP + ", spring-osgi-web-extender," + getSpringDMVersion());
col.add("net.sourceforge.cglib, com.springsource.net.sf.cglib, 2.1.3");
// the war
col.add(SPRING_OSGI_GROUP + ".samples.simple-web-app, war, " + getSpringDMVersion() + ",war");
return (String[]) col.toArray(new String[col.size()]);
}
示例4: createApplicationPage
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
public ApplicationPage createApplicationPage(ApplicationWindow window, PageDescriptor descriptor) {
if (JdkVersion.isAtLeastJava16()) {
return new TabbedSwingDockingApplicationPage(window, descriptor);
} else if (JdkVersion.isAtLeastJava15()) {
return new SwingDockingApplicationPage(window, descriptor);
} else {
return new DesktopApplicationPage(window, descriptor, JDesktopPane.OUTLINE_DRAG_MODE, new DefaultDesktopCommandGroupFactory());
}
}
示例5: getIndexedPropertyKeyType
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
/**
* Determine the type of the key used to index the collection/map. When jdk
* is at least 1.5, maps can be specified with generics and their key type
* can be resolved.
*
* @param propertyName name of the property.
* @return the type of the key. An integer if it's not a map, {@link String}
* if the jdk is less than 1.5, a specific type if the map was generified.
*/
public Class getIndexedPropertyKeyType(String propertyName) {
if (!PropertyAccessorUtils.isIndexedProperty(propertyName)) {
throw new IllegalArgumentException("'" + propertyName + "' is no indexed property");
}
Class type = getPropertyType(getParentPropertyName(propertyName));
if (!Map.class.isAssignableFrom(type)) {
return Integer.class;
}
if (JdkVersion.isAtLeastJava15()) {
int nestingLevel = PropertyAccessorUtils.getNestingLevel(propertyName) - 1;
Member accessor = getPropertyAccessor(getRootPropertyName(propertyName));
if (accessor instanceof Field) {
return GenericCollectionTypeResolver.getMapKeyFieldType((Field) accessor, nestingLevel);
}
else if (accessor instanceof Method) {
MethodParameter parameter = new MethodParameter((Method) accessor, ((Method) accessor)
.getParameterTypes().length - 1, nestingLevel);
return GenericCollectionTypeResolver.getMapKeyParameterType(parameter);
}
else {
throw new InvalidPropertyException(getTargetClass(), propertyName, "property not accessable");
}
}
else {
return String.class; // the default for Java 1.4
}
}
示例6: createDesktopPane
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
protected JDesktopPane createDesktopPane() {
if (!JdkVersion.isAtLeastJava15()) {
throw new IllegalStateException("At least Java Version 5 is needed for Swing-Docking.");
}
return new DockingDesktopPane();
}
示例7: getPropertyType
import org.springframework.core.JdkVersion; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public Class getPropertyType(String propertyName) {
if (PropertyAccessorUtils.isIndexedProperty(propertyName)) {
int nestingLevel = PropertyAccessorUtils.getNestingLevel(propertyName);
if (JdkVersion.isAtLeastJava15()) {
Member accessor = getPropertyAccessor(getRootPropertyName(propertyName));
if (accessor instanceof Field) {
return GenericCollectionTypeResolver.getIndexedValueFieldType((Field) accessor, nestingLevel);
}
else {
Method accessorMethod = (Method) accessor;
MethodParameter parameter = new MethodParameter(accessorMethod,
accessorMethod.getParameterTypes().length - 1);
return GenericCollectionTypeResolver.getIndexedValueMethodType(parameter, nestingLevel);
}
}
else {
// we can only resolve array types in Java 1.4
Class type = getPropertyType(getRootPropertyName(propertyName));
for (int i = 0; i < nestingLevel; i++) {
if (type.isArray()) {
type = type.getComponentType();
}
else {
return Object.class; // cannot resolve type
}
}
return type;
}
}
else {
Member readAccessor = (Member) readAccessors.get(propertyName);
if (readAccessor instanceof Field) {
return ((Field) readAccessor).getType();
}
else if (readAccessor instanceof Method) {
return ((Method) readAccessor).getReturnType();
}
Member writeAccessor = (Member) writeAccessors.get(propertyName);
if (writeAccessor instanceof Field) {
return ((Field) writeAccessor).getType();
}
else if (writeAccessor instanceof Method) {
return ((Method) writeAccessor).getParameterTypes()[0];
}
}
return null;
}