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.library;
 
 
 
 import static com.github.fge.jsonschema.messages.ValidationConfigurationMessages.*;

Frozen keyword

See also:
KeywordBuilder
 
 public final class Keyword
     implements Frozen<KeywordBuilder>
 {
    
Name of this keyword
 
     final String name;

    
Syntax checker
 
     final SyntaxChecker syntaxChecker;

    
Digester
 
     final Digester digester;

    
 
     final Constructor<? extends KeywordValidatorconstructor;

    
Instantiate a new keyword builder

Parameters:
name the name for this keyword
Returns:
a new KeywordBuilder
Throws:
com.github.fge.jsonschema.exceptions.unchecked.ValidationConfigurationError provided name is null
See also:
KeywordBuilder.KeywordBuilder.(java.lang.String)
 
     public static KeywordBuilder newBuilder(final String name)
     {
         return new KeywordBuilder(name);
     }

    
Build a frozen keyword out of a thawed one

Parameters:
builder the keyword builder to build from
Throws:
com.github.fge.jsonschema.exceptions.unchecked.ValidationConfigurationError no syntax checker defined, or a validator class is defined but no digester has been found
See also:
KeywordBuilder.freeze()
 
     Keyword(final KeywordBuilder builder)
     {
          = builder.name;
          = builder.syntaxChecker;
         if ( == null)
             throw new ValidationConfigurationError(new ProcessingMessage()
                 .message());
         if (builder.constructor != null && builder.digester == null)
             throw new ValidationConfigurationError(new ProcessingMessage()
                 .message());
          = builder.digester;
          = builder.constructor;
     }

    
Create a thawed version of this keyword

 
    @Override
    public KeywordBuilder thaw()
    {
        return new KeywordBuilder(this);
    }
New to GrepCode? Check out our FAQ X