APIdia Launch Partner
Top Description Fields Constructors Methods
javax.print.attribute

public abstract Class TextSyntax

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
javax.print.attribute.standard.DocumentName, javax.print.attribute.standard.JobMessageFromOperator, javax.print.attribute.standard.JobName, javax.print.attribute.standard.JobOriginatingUserName, javax.print.attribute.standard.OutputDeviceAssigned, javax.print.attribute.standard.PrinterInfo, javax.print.attribute.standard.PrinterLocation, javax.print.attribute.standard.PrinterMakeAndModel, javax.print.attribute.standard.PrinterMessageFromOperator, javax.print.attribute.standard.PrinterName, javax.print.attribute.standard.RequestingUserName
Imports
java.io.Serial, .Serializable, java.util.Locale

Class TextSyntax is an abstract base class providing the common implementation of all attributes whose value is a string. The text attribute includes a locale to indicate the natural language. Thus, a text attribute always represents a localized string. Once constructed, a text attribute's value is immutable.
Authors
David Mendenhall, Alan Kaminsky

Field Summary

Modifier and TypeField and Description
private Locale
locale

Locale of this text attribute.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.4 for interoperability.

private String
value

String value of this text attribute.

Constructor Summary

AccessConstructor and Description
protected
TextSyntax(String
text string
value
,
Locale
natural language of the text string. null is interpreted to mean the default locale for as returned by Locale.getDefault()
locale
)

Constructs a TextAttribute with the specified string and locale.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if object is equivalent to this text attribute, false otherwise
equals
(Object
Object to compare to
object
)

Overrides java.lang.Object.equals.

Returns whether this text attribute is equivalent to the passed in object.

public Locale

Returns:

the locale
getLocale
()

Returns this text attribute's text string's natural language (locale).

public String

Returns:

the text string
getValue
()

Returns this text attribute's text string.

public int

Returns:

a hashcode value for this object
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hashcode for this text attribute.

public String

Returns:

a String identifying this object
toString
()

Overrides java.lang.Object.toString.

Returns a String identifying this text attribute.

private static String
verify(String value)

private static Locale
verify(Locale locale)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

localeback to summary
private Locale locale

Locale of this text attribute.

serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.4 for interoperability.

Annotations
@Serial
valueback to summary
private String value

String value of this text attribute.

Constructor Detail

TextSyntaxback to summary
protected TextSyntax(String value, Locale locale)

Constructs a TextAttribute with the specified string and locale.

Parameters
value:String

text string

locale:Locale

natural language of the text string. null is interpreted to mean the default locale for as returned by Locale.getDefault()

Exceptions
NullPointerException:
if value is null

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Returns whether this text attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:

  1. object is not null.
  2. object is an instance of class TextSyntax.
  3. This text attribute's underlying string and object's underlying string are equal.
  4. This text attribute's locale and object's locale are equal.
Parameters
object:Object

Object to compare to

Returns:boolean

true if object is equivalent to this text attribute, false otherwise

Annotations
@Override
getLocaleback to summary
public Locale getLocale()

Returns this text attribute's text string's natural language (locale).

Returns:Locale

the locale

getValueback to summary
public String getValue()

Returns this text attribute's text string.

Returns:String

the text string

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hashcode for this text attribute.

Returns:int

a hashcode value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String identifying this text attribute. The String is the attribute's underlying text string.

Returns:String

a String identifying this object

Annotations
@Override
verifyback to summary
private static String verify(String value)
verifyback to summary
private static Locale verify(Locale locale)