Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2013, Francis Galiegue <fgaliegue@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the Lesser GNU General Public License as
  * published by the Free Software Foundation, either version 3 of the
  * License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Lesser GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.github.fge.jsonschema.processors.data;
import  javax.annotation.concurrent.Immutable;

Validation data for a validation processor

The included data are the schema (in the shape of a SchemaTree and the instance to validate (in the shape of a JsonTree.

The ProcessingMessage template generated contains information about both the schema and instance.

@Immutable
public final class FullData
    implements MessageProvider
    private final SchemaTree schema;
    private final JsonTree instance;
    public FullData(final SchemaTree schemafinal JsonTree instance)
    {
        this. = schema;
        this. = instance;
    }
    public FullData(final SchemaTree schema)
    {
        this(schemanull);
    }
    public SchemaTree getSchema()
    {
        return ;
    }
    public JsonTree getInstance()
    {
        return ;
    }

    
Return a new full data with another schema

Parameters:
schema the schema
Returns:
a new full data instance
    public FullData withSchema(final SchemaTree schema)
    {
        return new FullData(schema);
    }

    
Return a new full data with another instance

Parameters:
instance the new instance
Returns:
a new full data instance
    public FullData withInstance(final JsonTree instance)
    {
        return new FullData(instance);
    }
    @Override
    public ProcessingMessage newMessage()
    {
        final ProcessingMessage ret = new ProcessingMessage();
        if ( != null)
            ret.put("schema");
        if ( != null)
            ret.put("instance");
        return ret;
    }
New to GrepCode? Check out our FAQ X