All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.metadata.commons.CommonsAttributes Maven / Gradle / Ivy

There is a newer version: 5.3.34
Show newest version
/*
 * Copyright 2002-2005 the original author or authors.
 * 
 * Licensed 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.springframework.metadata.commons;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;

import org.springframework.metadata.Attributes;

/**
 * Implementation of the Spring Attributes facade for Commons Attributes.
 *
 * 

Please see the * * Commons Attributes documentation for information on how to use the * attribute compiler. * *

As of December 2003, follow the Javadocs to the AttributeCompiler class * to see how the Ant task works. Note that you need to put the following jars * in your $ANT_HOME/lib directory for the Common Attributes compiler to work: *

    *
  • Commons Attributes compiler jar *
  • the xjavadoc Jar (from XDoclet) *
  • commons-collection.jar (from Jakarta Commons) *
* *

You need to perform the attribute compilation step before compiling your source. * *

See build.xml in the tests for package org.springframework.aop.autoproxy.metadata * for an example of the required Ant scripting. The header of this build script * includes some quick, and hopefully useful, hints on using Commons Attributes. * The source files in the same package (TxClass and TxClassWithClassAttribute) * illustrate attribute usage in source files. * *

The Spring Framework project does not provide support usage of specific * attributes implementations. Please refer to the appropriate site and mailing * list of the attributes implementation. * * @author Rod Johnson */ public class CommonsAttributes implements Attributes { /* * Commons Attributes caches attributes, so we don't need to cache here * as well. */ public Collection getAttributes(Class targetClass) { return org.apache.commons.attributes.Attributes.getAttributes(targetClass); } public Collection getAttributes(Class targetClass, Class filter) { return org.apache.commons.attributes.Attributes.getAttributes(targetClass, filter); } public Collection getAttributes(Method targetMethod) { return org.apache.commons.attributes.Attributes.getAttributes(targetMethod); } public Collection getAttributes(Method targetMethod, Class filter) { return org.apache.commons.attributes.Attributes.getAttributes(targetMethod, filter); } public Collection getAttributes(Field targetField) { return org.apache.commons.attributes.Attributes.getAttributes(targetField); } public Collection getAttributes(Field targetField, Class filter) { return org.apache.commons.attributes.Attributes.getAttributes(targetField, filter); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy