Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2014, Francis Galiegue (
  * This software is dual-licensed under:
  * - the Lesser General Public License (LGPL) version 3.0 or, at your option, any
  *   later version;
  * - the Apache Software License (ASL) version 2.0.
 * The text of this file and of both licenses is available at the root of this
 * project or, if you have the jar distribution, in directory META-INF/, under
 * the names LGPL-3.0.txt and ASL-2.0.txt respectively.
 * Direct link to the sources:
 * - LGPL 3.0:
 * - ASL 2.0:
package com.github.fge.jsonschema.format;
Base abstract class for a format attribute

You should really use this class instead of implementing FormatAttribute directly. Its main, but important, helping role is to build the list of supported types for you.

public abstract class AbstractFormatAttribute
    implements FormatAttribute
The set of supported types
    private final EnumSet<NodeTypesupported;

The name of the format attribute
    private final String fmt;

Protected constructor

fmt the name for this format attribute
first first supported type
other other supported types, if any
See also:
    protected AbstractFormatAttribute(final String fmtfinal NodeType first,
        final NodeType... other)
        this. = fmt;
         = EnumSet.of(firstother);
    public final EnumSet<NodeTypesupportedTypes()
        return EnumSet.copyOf();

Return a new message for this format attribute

data the validation context
key key in the format bundle message
a new message
    protected final ProcessingMessage newMsg(final FullData data,
        final MessageBundle bundlefinal String key)
        return data.newMessage().put("domain""validation")
New to GrepCode? Check out our FAQ X