org.schwa.dr
Class DocSchema

java.lang.Object
  extended by org.schwa.dr.AnnSchema
      extended by org.schwa.dr.DocSchema

public final class DocSchema
extends AnnSchema

Schema class for docrep annotation Doc implementations.

Author:
Tim Dawborn

Field Summary
static Class<?>[] ALLOWED_FIELD_KLASSES
           
static Class<? extends Annotation>[] ANNOTATION_KLASSES
           
protected  List<AnnSchema> annSchemas
           
protected  List<StoreSchema> storeSchemas
           
 
Fields inherited from class org.schwa.dr.AnnSchema
fieldSchemas, klass, name, serial
 
Method Summary
 void addSchema(AnnSchema annSchema)
          Adds an AnnSchema schema that this document class has annotation instances for.
 void addStore(StoreSchema storeSchema)
          Adds a new StoreSchema to the list of fields on this document class.
static
<T extends Doc>
DocSchema
create(Class<T> klass)
           
 AnnSchema getSchema(Class<? extends Ann> klass)
          Returns the schema for the annotation on this document class whose Class matches the provided class.
 List<AnnSchema> getSchemas()
          Returns a list of schema objects for all annotation types that this document contains.
 StoreSchema getStore(String name)
          Returns the schema for the stores on this annotation class whose name matches the provided name.
 List<StoreSchema> getStores()
          Returns a list of schema objects for all of the stores on this annotation class.
 boolean hasStore(String name)
          Returns whether or not this document has a store with the provided name.
 boolean hasStores()
          Returns whether or not this document class has any stores.
 
Methods inherited from class org.schwa.dr.AnnSchema
addField, create, create, getField, getField, getFields, getKlass, getName, getSerial, hasFields, setSerial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOWED_FIELD_KLASSES

public static final Class<?>[] ALLOWED_FIELD_KLASSES

ANNOTATION_KLASSES

public static final Class<? extends Annotation>[] ANNOTATION_KLASSES

annSchemas

protected List<AnnSchema> annSchemas

storeSchemas

protected List<StoreSchema> storeSchemas
Method Detail

addSchema

public void addSchema(AnnSchema annSchema)
Adds an AnnSchema schema that this document class has annotation instances for.


addStore

public void addStore(StoreSchema storeSchema)
Adds a new StoreSchema to the list of fields on this document class.


getSchema

public AnnSchema getSchema(Class<? extends Ann> klass)
Returns the schema for the annotation on this document class whose Class matches the provided class. This method returns null if no annotation class matches.


getSchemas

public List<AnnSchema> getSchemas()
Returns a list of schema objects for all annotation types that this document contains.


getStore

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


getStores

public List<StoreSchema> getStores()
Returns a list of schema objects for all of the stores on this annotation class.


hasStore

public boolean hasStore(String name)
Returns whether or not this document has a store with the provided name.

See Also:
getStore(java.lang.String)

hasStores

public boolean hasStores()
Returns whether or not this document class has any stores.


create

public static <T extends Doc> DocSchema create(Class<T> klass)


Copyright © 2014. All rights reserved.