Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2013, Francis Galiegue <>
  * 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
 * 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 <>.
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
    private static final MessageBundle BUNDLE = .;

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 String key)
        return data.newMessage().put("domain""validation")
New to GrepCode? Check out our FAQ X