001: /*
002: * $RCSfile: RegistryElementDescriptor.java,v $
003: *
004: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Use is subject to license terms.
007: *
008: * $Revision: 1.1 $
009: * $Date: 2005/02/11 04:57:19 $
010: * $State: Exp $
011: */
012: package javax.media.jai;
013:
014: /**
015: * An interface for all JAI descriptors that register themselves
016: * with the <code>OperationRegistry</code>. Examples include
017: * <code>OperationDescriptor</code>, <code>TileCodecDescriptor</code>,
018: * <code>RemoteDescriptor</code> etc.
019: *
020: * @see OperationRegistry
021: * @see RegistryMode
022: *
023: * @since JAI 1.1
024: */
025: public interface RegistryElementDescriptor {
026:
027: /**
028: * The name this descriptor will be registered under in the
029: * <code>OperationRegistry</code>. Individual descriptors
030: * implementing this interface will define what this name means
031: * in their space. For example this would be "operation name" for
032: * <code>OperationDescriptor</code> and "format name" for
033: * <code>TileCodecDescriptor</code> etc. The descriptor
034: * names are to be treated in a case-insensitive (but retentive) manner.
035: */
036: String getName();
037:
038: /**
039: * The registry modes supported by this descriptor. Known modes
040: * include those returned by <code>RegistryMode.getModes()</code>.
041: *
042: * @return an array of <code>String</code>s specifying the supported modes.
043: *
044: * @see RegistryMode
045: */
046: String[] getSupportedModes();
047:
048: /**
049: * Whether this descriptor supports the specified registry mode.
050: * The <code>modeName</code>s are to be treated in a case-insensitive
051: * (but retentive) manner.
052: *
053: * @param modeName the registry mode name
054: *
055: * @return true, if the implementation of this descriptor supports
056: * the specified mode. false otherwise.
057: *
058: * @throws IllegalArgumentException if <code>modeName</code> is null
059: */
060: boolean isModeSupported(String modeName);
061:
062: /**
063: * Whether this descriptor supports JAI properties.
064: *
065: * @return <code>true</code>, if the implementation of this descriptor
066: * supports JAI properties. <code>false</code> otherwise.
067: *
068: * @see PropertyGenerator
069: */
070: boolean arePropertiesSupported();
071:
072: /**
073: * Returns an array of <code>PropertyGenerator</code>s implementing
074: * the property inheritance for this descriptor. They may be used
075: * as a basis for the descriptor's property management.
076: *
077: * @param modeName the registry mode name
078: *
079: * @return An array of <code>PropertyGenerator</code>s, or
080: * <code>null</code> if this operation does not have any of
081: * its own <code>PropertyGenerator</code>s.
082: *
083: * @throws IllegalArgumentException if <code>modeName</code> is null
084: * or if it is not one of the supported modes.
085: * @throws UnsupportedOperationException if <code>arePropertiesSupported()</code>
086: * returns <code>false</code>
087: */
088: PropertyGenerator[] getPropertyGenerators(String modeName);
089:
090: /**
091: * Returns the <code>ParameterListDescriptor</code> that describes
092: * the associated parameters (<u>not</u> sources). This method returns
093: * null if the specified modeName does not support parameters.
094: * If the specified modeName supports parameters but the
095: * implementing class does not have parameters, then this method
096: * returns a non-null <code>ParameterListDescriptor</code> whose
097: * <code>getNumParameters()</code> returns 0.
098: *
099: * @param modeName the registry mode name.
100: *
101: * @throws IllegalArgumentException if <code>modeName</code> is null
102: * or if it is not one of the supported modes.
103: */
104: ParameterListDescriptor getParameterListDescriptor(String modeName);
105: }
|