java.lang.Objectjavax.print.attribute.AttributeSetUtilities
public final class AttributeSetUtilities
Class AttributeSetUtilities provides static methods for manipulating AttributeSets.
AttributeSet
An unmodifiable view U of an AttributeSet S provides a client with "read-only" access to S. Query operations on U "read through" to S; thus, changes in S are reflected in U. However, any attempt to modify U, results in an UnmodifiableSetException. The unmodifiable view object U will be serializable if the attribute set object S is serializable.
A synchronized view V of an attribute set S provides a client with synchronized (multiple thread safe) access to S. Each operation of V is synchronized using V itself as the lock object and then merely invokes the corresponding operation of S. In order to guarantee mutually exclusive access, it is critical that all access to S is accomplished through V. The synchronized view object V will be serializable if the attribute set object S is serializable.
As mentioned in the package description of javax.print, a null reference parameter to methods is incorrect unless explicitly documented on the method as having a meaningful interpretation. Usage to the contrary is incorrect coding and may result in a run time exception either immediately or at some later time. IllegalArgumentException and NullPointerException are examples of typical and acceptable run time exceptions for such cases.
| Method Summary | |
|---|---|
static AttributeSet |
synchronizedView(AttributeSet attributeSet)
Creates a synchronized view of the given attribute set. |
static DocAttributeSet |
synchronizedView(DocAttributeSet attributeSet)
Creates a synchronized view of the given doc attribute set. |
static PrintJobAttributeSet |
synchronizedView(PrintJobAttributeSet attributeSet)
Creates a synchronized view of the given print job attribute set. |
static PrintRequestAttributeSet |
synchronizedView(PrintRequestAttributeSet attributeSet)
Creates a synchronized view of the given print request attribute set. |
static PrintServiceAttributeSet |
synchronizedView(PrintServiceAttributeSet attributeSet)
Creates a synchronized view of the given print service attribute set. |
static AttributeSet |
unmodifiableView(AttributeSet attributeSet)
Creates an unmodifiable view of the given attribute set. |
static DocAttributeSet |
unmodifiableView(DocAttributeSet attributeSet)
Creates an unmodifiable view of the given doc attribute set. |
static PrintJobAttributeSet |
unmodifiableView(PrintJobAttributeSet attributeSet)
Creates an unmodifiable view of the given print job attribute set. |
static PrintRequestAttributeSet |
unmodifiableView(PrintRequestAttributeSet attributeSet)
Creates an unmodifiable view of the given print request attribute set. |
static PrintServiceAttributeSet |
unmodifiableView(PrintServiceAttributeSet attributeSet)
Creates an unmodifiable view of the given print service attribute set. |
static Class<?> |
verifyAttributeCategory(Object object,
Class<?> interfaceName)
Verify that the given object is a Class that
implements the given interface, which is assumed to be interface Attribute or a subinterface thereof. |
static Attribute |
verifyAttributeValue(Object object,
Class<?> interfaceName)
Verify that the given object is an instance of the given interface, which is assumed to be interface Attribute or a subinterface
thereof. |
static void |
verifyCategoryForValue(Class<?> category,
Attribute attribute)
Verify that the given attribute category object is equal to the category of the given attribute value object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AttributeSet unmodifiableView(AttributeSet attributeSet)
attributeSet - Underlying attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null. Null is never apublic static DocAttributeSet unmodifiableView(DocAttributeSet attributeSet)
attributeSet - Underlying doc attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet)
attributeSet - Underlying print request attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet)
attributeSet - Underlying print job attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet)
attributeSet - Underlying print service attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static AttributeSet synchronizedView(AttributeSet attributeSet)
attributeSet - Underlying attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet)
attributeSet - Underlying doc attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet)
attributeSet - Underlying print request attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet)
attributeSet - Underlying print job attribute set.
attributeSet.
NullPointerException - Thrown if attributeSet is null.public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet)
attributeSet - Underlying print service attribute set.
attributeSet.public static Class<?> verifyAttributeCategory(Object object, Class<?> interfaceName)
Class that
implements the given interface, which is assumed to be interface Attribute or a subinterface thereof.
object - Object to test.interfaceName - Interface the object must implement.
object is a Class
that implements interfaceName,
object is returned downcast to type Class; otherwise an exception is thrown.
NullPointerException - (unchecked exception) Thrown if object is null.
ClassCastException - (unchecked exception) Thrown if object is not a
Class that implements
interfaceName.public static Attribute verifyAttributeValue(Object object, Class<?> interfaceName)
Attribute or a subinterface
thereof.
object - Object to test.interfaceName - Interface of which the object must be an instance.
object is an instance of
interfaceName, object is returned
downcast to type Attribute; otherwise an
exception is thrown.
NullPointerException - (unchecked exception) Thrown if object is null.
ClassCastException - (unchecked exception) Thrown if object is not an
instance of interfaceName.public static void verifyCategoryForValue(Class<?> category, Attribute attribute)
category - Attribute category to test.attribute - Attribute value to test.
NullPointerException - (unchecked exception) Thrown if the category is
null or if the attribute is null.
IllegalArgumentException - (unchecked exception) Thrown if the category is not
equal to the category of the attribute.Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)