edu.rice.cs.cunit.classFile.constantPool.visitors
Class CheckUTFVisitor

java.lang.Object
  extended by edu.rice.cs.cunit.classFile.constantPool.visitors.ADefaultPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>
      extended by edu.rice.cs.cunit.classFile.constantPool.visitors.CheckUTFVisitor
All Implemented Interfaces:
IPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>

public class CheckUTFVisitor
extends ADefaultPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>

Check that the host is a UTF info.

Author:
Mathias Ricken

Field Summary
private static CheckUTFVisitor _instance
          Singleton instance.
 
Constructor Summary
private CheckUTFVisitor()
          Singleton constructor.
 
Method Summary
 AUTFPoolInfo asciizCase(ASCIIPoolInfo host, java.lang.Object o)
          Return host.
 AUTFPoolInfo defaultCase(APoolInfo host, java.lang.Object o)
          All other cases throw.
static CheckUTFVisitor singleton()
          Singleton accessor.
 AUTFPoolInfo unicodeCase(UnicodePoolInfo host, java.lang.Object o)
          Return host.
 
Methods inherited from class edu.rice.cs.cunit.classFile.constantPool.visitors.ADefaultPoolInfoVisitor
classCase, doubleCase, emptyCase, fieldCase, floatCase, intCase, interfaceMethodCase, longCase, methodCase, nameAndTypeCase, stringCase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_instance

private static CheckUTFVisitor _instance
Singleton instance.

Constructor Detail

CheckUTFVisitor

private CheckUTFVisitor()
Singleton constructor.

Method Detail

singleton

public static CheckUTFVisitor singleton()
Singleton accessor.

Returns:
singleton

defaultCase

public AUTFPoolInfo defaultCase(APoolInfo host,
                                java.lang.Object o)
All other cases throw.

Specified by:
defaultCase in class ADefaultPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>
Parameters:
host - non-UTF host
o - not used
Returns:
nothing

asciizCase

public AUTFPoolInfo asciizCase(ASCIIPoolInfo host,
                               java.lang.Object o)
Return host.

Specified by:
asciizCase in interface IPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>
Overrides:
asciizCase in class ADefaultPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>
Parameters:
host - UTF host
o - not used
Returns:
host

unicodeCase

public AUTFPoolInfo unicodeCase(UnicodePoolInfo host,
                                java.lang.Object o)
Return host.

Specified by:
unicodeCase in interface IPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>
Overrides:
unicodeCase in class ADefaultPoolInfoVisitor<AUTFPoolInfo,java.lang.Object>
Parameters:
host - UTF host
o - not used
Returns:
host