org.mule.common.metadata.parser.json
Class JSONFileType

java.lang.Object
  extended by org.mule.common.metadata.parser.json.AbstractType
      extended by org.mule.common.metadata.parser.json.JSONFileType
All Implemented Interfaces:
JSONType

public class JSONFileType
extends AbstractType

Lazy type loading for JSON schema files. Objects of this class correspond to files on the filesystem, each given by a File, which contain JSON Schema expressions. However, the JSON schema expression is only loaded and parsed the first time that either contains or explain is called on this object: lazy loading. This is so that we can support resolution of mutually-recursive types, from files in a single directory.

Author:
Timothy Danford

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mule.common.metadata.parser.json.JSONType
JSONType.BooleanType, JSONType.DoubleType, JSONType.Empty, JSONType.Everything, JSONType.IntegerType, JSONType.NumberType, JSONType.StringType
 
Constructor Summary
JSONFileType(SchemaEnv env, File f)
           
 
Method Summary
 boolean contains(Object obj)
          The central method of JSONType; the type encompasses the values for which contains returns true.
 String explain(Object obj)
          Returns a non-null String explanation, suitable for display to a user, explaining why the given object fails to conform to the JSONType's contains method.
 boolean isJSONArray()
           
 boolean isJSONObject()
           
 boolean isJSONPointer()
           
 boolean isJSONPrimitive()
           
 void loadType()
           
 void loadType(File f)
           
 void loadType(Reader reader)
           
 
Methods inherited from class org.mule.common.metadata.parser.json.AbstractType
isOptional
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONFileType

public JSONFileType(SchemaEnv env,
                    File f)
Method Detail

loadType

public void loadType(File f)

loadType

public void loadType(Reader reader)

loadType

public void loadType()

contains

public boolean contains(Object obj)
Description copied from interface: JSONType
The central method of JSONType; the type encompasses the values for which contains returns true.

Specified by:
contains in interface JSONType
Specified by:
contains in class AbstractType
Returns:
trueif the given Object satisfies the type, false otherwise.

explain

public String explain(Object obj)
Description copied from interface: JSONType
Returns a non-null String explanation, suitable for display to a user, explaining why the given object fails to conform to the JSONType's contains method.

Specified by:
explain in interface JSONType
Overrides:
explain in class AbstractType
Returns:
an explanatory string if contains(arg) is false, or null if contains(arg) is true.

isJSONPrimitive

public boolean isJSONPrimitive()

isJSONArray

public boolean isJSONArray()

isJSONObject

public boolean isJSONObject()

isJSONPointer

public boolean isJSONPointer()


Copyright © 2015 MuleSoft, Inc.. All rights reserved.