org.codehaus.enunciate.contract.json
Class JsonSchemaInfo

java.lang.Object
  extended by org.codehaus.enunciate.contract.json.JsonSchemaInfo

public final class JsonSchemaInfo
extends java.lang.Object

Information about JSON type structures present.

Author:
Steven Cummings

Constructor Summary
JsonSchemaInfo(com.sun.mirror.declaration.PackageDeclaration schemaPackage)
          Create a new JsonSchemaInfo.
 
Method Summary
 java.lang.String getDocumentation()
           
 java.lang.String getSchemaId()
           
 java.util.Map<java.lang.String,JsonRootElementDeclaration> getTopLevelTypesByName()
           
 java.util.Collection<JsonTypeDefinition> getTypes()
           
 java.util.Map<java.lang.String,JsonTypeDefinition> getTypesByName()
           
static java.lang.String schemaIdForPackage(com.sun.mirror.declaration.PackageDeclaration schemaPackage)
           
static java.lang.String schemaIdForType(com.sun.mirror.declaration.ClassDeclaration delegate)
          Get the schema ID associated with the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonSchemaInfo

public JsonSchemaInfo(com.sun.mirror.declaration.PackageDeclaration schemaPackage)
Create a new JsonSchemaInfo.

Parameters:
schemaPackage - Declaration to create a JSON schema from.
Method Detail

schemaIdForType

public static java.lang.String schemaIdForType(com.sun.mirror.declaration.ClassDeclaration delegate)
Get the schema ID associated with the given class.

Parameters:
delegate - Class to get the associated schema ID for. Must not be null.
Returns:
Non-null Schema ID associated with the given class.
Throws:
java.lang.AssertionError - if the parameter conditions are not met and assertions are enabled.

schemaIdForPackage

public static java.lang.String schemaIdForPackage(com.sun.mirror.declaration.PackageDeclaration schemaPackage)
Parameters:
schemaPackage - Package to get the associated schema ID for. Must not be null.
Returns:
Non-null Schema ID associated with the given package.
Throws:
java.lang.AssertionError - if the parameter conditions are not met and assertions are enabled.

getSchemaId

public java.lang.String getSchemaId()
Returns:
The schema id.

getDocumentation

public java.lang.String getDocumentation()
Returns:
Schema documentation.

getTopLevelTypesByName

public java.util.Map<java.lang.String,JsonRootElementDeclaration> getTopLevelTypesByName()
Returns:
Non-null Map of top-level JSON types by type name, keyed by type-name.

getTypesByName

public java.util.Map<java.lang.String,JsonTypeDefinition> getTypesByName()
Returns:
Non-null Map of available JSON types in this schema, keyed by type-name.

getTypes

public java.util.Collection<JsonTypeDefinition> getTypes()
Returns:
Non-null Collection of available JSON types in this schema.