org.schwa.dr
Class AnnSchema

java.lang.Object
  extended by org.schwa.dr.AnnSchema
Direct Known Subclasses:
DocSchema

public class AnnSchema
extends Object

Schema class for docrep annotation Ann implementations.

Author:
Tim Dawborn

Field Summary
protected  List<FieldSchema> fieldSchemas
           
protected  Class<? extends Ann> klass
           
protected  String name
           
protected  String serial
           
 
Constructor Summary
protected AnnSchema(Class<? extends Ann> klass, String name, String serial)
           
 
Method Summary
 void addField(FieldSchema fieldSchema)
          Adds a new FieldSchema to the list of fields on this annotation class.
static AnnSchema create(Class<? extends Ann> klass, String name)
           
static AnnSchema create(Class<? extends Ann> klass, String name, String serial)
           
 FieldSchema getField(int index)
          Returns the schema for the index'th field on this annotation class.
 FieldSchema getField(String name)
          Returns the schema for the field on this annotation class whose name matches the provided name.
 List<FieldSchema> getFields()
          Returns a list of schema objects for all of the fields on this annotation class.
 Class<? extends Ann> getKlass()
          Returns the Class object for the underlying annotation class.
 String getName()
          Returns the name of this annotation class.
 String getSerial()
          Returns the serial name of this annotation class.
 boolean hasFields()
          Returns whether or not this annotation class has any fields.
 void setSerial(String serial)
          Sets the serial name of this annotation class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

klass

protected final Class<? extends Ann> klass

name

protected final String name

serial

protected String serial

fieldSchemas

protected List<FieldSchema> fieldSchemas
Constructor Detail

AnnSchema

protected AnnSchema(Class<? extends Ann> klass,
                    String name,
                    String serial)
Method Detail

addField

public void addField(FieldSchema fieldSchema)
Adds a new FieldSchema to the list of fields on this annotation class.


getKlass

public Class<? extends Ann> getKlass()
Returns the Class object for the underlying annotation class.


getField

public FieldSchema getField(int index)
Returns the schema for the index'th field on this annotation class.


getField

public FieldSchema getField(String name)
Returns the schema for the field on this annotation class whose name matches the provided name. This method returns null if no field matches.


getFields

public List<FieldSchema> getFields()
Returns a list of schema objects for all of the fields on this annotation class.


getName

public String getName()
Returns the name of this annotation class.


getSerial

public String getSerial()
Returns the serial name of this annotation class.


hasFields

public boolean hasFields()
Returns whether or not this annotation class has any fields.


setSerial

public void setSerial(String serial)
Sets the serial name of this annotation class.


create

public static AnnSchema create(Class<? extends Ann> klass,
                               String name)

create

public static AnnSchema create(Class<? extends Ann> klass,
                               String name,
                               String serial)


Copyright © 2014. All rights reserved.