diff -r dee0b5da8805 openide.filesystems/src/org/openide/filesystems/MIMEResolver.java --- a/openide.filesystems/src/org/openide/filesystems/MIMEResolver.java Sun Jan 08 18:24:40 2012 +0100 +++ b/openide.filesystems/src/org/openide/filesystems/MIMEResolver.java Tue Jan 10 11:57:59 2012 +0100 @@ -43,6 +43,10 @@ */ package org.openide.filesystems; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import java.util.Collection; import java.util.Map; import java.util.Set; @@ -178,4 +182,26 @@ } } + /** Declarative registration of a {@link MIMEResolver}. Allows simple + * registration in the most common cases via annotations attributes and + * complex registration by pointing to the rich XML definition. This + * annotation is processed during compile time and generates effective + * representation of the declaration in layer file. + * @since 7.60 + */ + @Target({ ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.PACKAGE, ElementType.TYPE }) + @Retention(RetentionPolicy.SOURCE) + public static @interface Registration { + /** The mime type this registration represents */ + public String mimeType(); + /** Extension(s) of a file to be recognized. */ + public String[] extension(); + /** Reference to detailed definition of the recognition rules. If this + * attribute is specified, leave {@link #extension()} empty - e.g. assigned + * to {}. + * + * @return relative path to the XML file describing registration for this mime type + */ + public String definition() default ""; + } }