com.google.caja.util
Class Name

java.lang.Object
  extended by com.google.caja.util.Name
All Implemented Interfaces:
MessagePart, java.lang.Comparable<Name>

public final class Name
extends java.lang.Object
implements java.lang.Comparable<Name>, MessagePart

A case insensitive identifier such as an element or identifier name that can be used for equality checks, and as a key in Maps and Sets.

This should be derived from a String as close to the parsing as possible so that it's obvious what kind of case-sensitivity conventions are required for the label.

Author:
mikesamuel@gmail.com

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.caja.reporting.MessagePart
MessagePart.Factory
 
Field Summary
private  java.lang.String canonicalForm
           
 
Constructor Summary
private Name(java.lang.String canonicalForm)
           
 
Method Summary
 int compareTo(Name that)
           
static Name css(java.lang.String cssName)
          The case-insensitive name of a CSS property, symbol, function or keyword.
 boolean equals(java.lang.Object o)
           
 void format(MessageContext context, java.lang.Appendable out)
          Formats this part to out.
 java.lang.String getCanonicalForm()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

canonicalForm

private final java.lang.String canonicalForm
Constructor Detail

Name

private Name(java.lang.String canonicalForm)
Method Detail

css

public static Name css(java.lang.String cssName)
The case-insensitive name of a CSS property, symbol, function or keyword.


getCanonicalForm

public java.lang.String getCanonicalForm()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(Name that)
Specified by:
compareTo in interface java.lang.Comparable<Name>

format

public void format(MessageContext context,
                   java.lang.Appendable out)
            throws java.io.IOException
Description copied from interface: MessagePart
Formats this part to out.

Specified by:
format in interface MessagePart
out - receives the formatted form of this.
Throws:
java.io.IOException


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0