org.mule.common.metadata.parser.json
Interface JSONType

All Known Implementing Classes:
AbstractType, JSONArrayType, JSONFileType, JSONObjectType, JSONPointerType, JSONResourceType, JSONType.BooleanType, JSONType.DoubleType, JSONType.Empty, JSONType.Everything, JSONType.IntegerType, JSONType.NumberType, JSONType.StringType, OptionalType

public interface JSONType

JSONType is implemented by classes which represent individual JSON schemas or types.

A JSONType determines a subset of Objects, through its contains method.

Given a JSONType, users should call the org.mule.common.metadata.parser.json.JSONType.contains method on values to see if each value is in the type.

Author:
Timothy Danford

Nested Class Summary
static class JSONType.BooleanType
           
static class JSONType.DoubleType
           
static class JSONType.Empty
           
static class JSONType.Everything
           
static class JSONType.IntegerType
           
static class JSONType.NumberType
           
static class JSONType.StringType
           
 
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()
           
 boolean isOptional()
           
 

Method Detail

contains

boolean contains(Object obj)
The central method of JSONType; the type encompasses the values for which contains returns true.

Returns:
trueif the given Object satisfies the type, false otherwise.

explain

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.

Returns:
an explanatory string if contains(arg) is false, or null if contains(arg) is true.

isOptional

boolean isOptional()
Returns:
true if the type will accept "missing" (i.e. null) values, false otherwise.

isJSONPrimitive

boolean isJSONPrimitive()

isJSONArray

boolean isJSONArray()

isJSONObject

boolean isJSONObject()

isJSONPointer

boolean isJSONPointer()


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