net.ontopia.topicmaps.impl.utils
Class ArgumentValidator

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.ArgumentValidator
Direct Known Subclasses:
ActionSignature, PredicateSignature

public class ArgumentValidator
extends java.lang.Object

INTERNAL: Instances of this class represent a signature of some predicate/function/object that takes a positional list of arguments and can validate whether a given list of arguments are valid according to the signature.


Field Summary
protected  java.util.List<Argument> arguments
           
protected static java.util.Map<java.lang.Class<?>,java.lang.String> typenames
           
 
Constructor Summary
ArgumentValidator(java.lang.String signature)
          INTERNAL: Creates a validator for the signature represented by this string.
 
Method Summary
 Argument getArgument(int ix)
          INTERNAL: Returns an Argument object representing the argument at this position in the signature.
static java.lang.String getClassList(java.lang.Object[] classes)
          INTERNAL: Returns a nicely formatted list of class names.
static java.lang.String getClassName(java.lang.Class klass)
          INTERNAL: Returns a string name for the class.
static java.lang.String getClassName(java.lang.Object object)
          INTERNAL: Returns a string name for the class of this object.
 java.lang.Class[] getTypes(int ix)
           
 void interpretCharacter(char ch, Argument curarg)
          INTERNAL: Interprets the given character and updates the argument to record the information in the character.
static java.lang.String makeSignature(java.lang.Object[] types)
          INTERNAL: Turns a list of class types into a signature string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arguments

protected java.util.List<Argument> arguments

typenames

protected static java.util.Map<java.lang.Class<?>,java.lang.String> typenames
Constructor Detail

ArgumentValidator

public ArgumentValidator(java.lang.String signature)
INTERNAL: Creates a validator for the signature represented by this string.

Method Detail

interpretCharacter

public void interpretCharacter(char ch,
                               Argument curarg)
INTERNAL: Interprets the given character and updates the argument to record the information in the character.
 x    TMObjectIF (equivalent to mtarbvo)
 m    TopicMapIF
 t    TopicIF
 a    AssociationIF
 r    AssociationRoleIF
 b    TopicNameIF
 v    VariantNameIF
 o    OccurrenceIF
 l    LocatorIF

 p    Pair (tolog-specific)
 B    Boolean
 s    String
 n    Number (float + integer)
 i    Integer
 f    Float
 .    Object
 z    PredicateOptions (tolog-specific wizardry)

 ?    optional argument
 +    repeatable argument
 &    multiple values
 !    tolog: argument must be bound; webed: argument must have a value
 


getTypes

public java.lang.Class[] getTypes(int ix)

getArgument

public Argument getArgument(int ix)
INTERNAL: Returns an Argument object representing the argument at this position in the signature.


makeSignature

public static java.lang.String makeSignature(java.lang.Object[] types)
INTERNAL: Turns a list of class types into a signature string.

Parameters:
types - The list of class types.
Returns:
The generated signature string.

getClassName

public static java.lang.String getClassName(java.lang.Class klass)
INTERNAL: Returns a string name for the class.


getClassName

public static java.lang.String getClassName(java.lang.Object object)
INTERNAL: Returns a string name for the class of this object.


getClassList

public static java.lang.String getClassList(java.lang.Object[] classes)
INTERNAL: Returns a nicely formatted list of class names.



Copyright © 2000-2012 Ontopia.