public final class AttributeSetUtilities extends Object
AttributeSet的实现的操作 AttributeSet 一个不可修改的视图 U为客户端提供了对S的 “只读”访问权限。 查询操作U “通读”到S ; 因此, S中的变化反映在U中 。 但是,任何修改U的尝试都会导致UnmodifiableSetException异常。 如果属性集对象S是可序列化的,则不可修改的视图对象U将是可序列化的。
属性集 同步视图 V为客户端提供了同步(多线程安全)对S的访问。 V的每个操作都使用V本身作为锁定对象进行同步,然后仅调用S的相应操作 。 为了保证互相访问,通过V完成对S的所有访问都是至关重要的。 如果属性集对象S是可序列化的,则同步视图对象V将是可序列化的。
如javax.print的包描述中所述,方法的空引用参数是不正确的,除非在方法中明确记录为具有有意义的解释。 使用相反的是错误的编码,可能会立即或稍后导致运行时异常。 IllegalArgumentException和NullPointerException是这种情况的典型和可接受的运行时间异常的示例。
public static AttributeSet unmodifiableView(AttributeSet attributeSet)
attributeSet - 底层属性集。
attributeSet 。
NullPointerException - 如果attributeSet为空,则抛出。
空不是一个
public static DocAttributeSet unmodifiableView(DocAttributeSet attributeSet)
attributeSet - 基础doc属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet)
attributeSet - 底层打印请求属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet)
attributeSet - 底层打印作业属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet)
attributeSet - 底层打印服务属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static AttributeSet synchronizedView(AttributeSet attributeSet)
attributeSet - 基础属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet)
attributeSet - 基础doc属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet)
attributeSet - 底层打印请求属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet)
attributeSet - 底层打印作业属性集。
attributeSet 。
NullPointerException - 如果
attributeSet为空,则抛出。
public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet)
attributeSet - 底层打印服务属性集。
attributeSet 。
public static 类<?> verifyAttributeCategory(Object object, 类<?> interfaceName)
object - 要测试的对象。
interfaceName - 对象必须实现的接口。
object是类实现interfaceName , object返回垂头丧气键入类 ;
否则抛出异常。
NullPointerException - (未选中的异常)如果
object为空,则抛出。
ClassCastException - (未经检查的异常)如果object不是类实现interfaceName ,则interfaceName 。
public static Attribute verifyAttributeValue(Object object, 类<?> interfaceName)
Attribute或其子接口。
object - 要测试的对象。
interfaceName - 对象必须是实例的接口。
object是object的一个实例, interfaceName object返回到Attribute ;
否则抛出异常。
NullPointerException - (未经检查的异常)如果
object为空,则抛出。
ClassCastException - (未经检查的异常)如果
object不是
object的实例,则
interfaceName 。
public static void verifyCategoryForValue(类<?> category, Attribute attribute)
category - 要测试的属性类别。
attribute - 要测试的属性值。
NullPointerException - (未经检查的异常)如果抛出该异常
category为空,或者如果
attribute为null。
IllegalArgumentException - (未经检查的异常)如果
category不等于
category的类别,则
attribute 。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.