All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.persistence.internal.jaxb.json.schema.model.JsonSchema Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
/*******************************************************************************
 * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
 * which accompanies this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *     Matt MacIvor - 2.5.1 - Initial Implementation
 ******************************************************************************/
package org.eclipse.persistence.internal.jaxb.json.schema.model;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;

import org.eclipse.persistence.internal.jaxb.json.schema.JsonSchemaGenerator;
import org.eclipse.persistence.oxm.annotations.XmlVariableNode;

/**
 * INTERNAL:
 * 

Purpose: * This class is the root of a JAXB model representing a JSON Schema. An instance is created * by the JsonSchemaGenerator based on an EclipseLink project and marshalled out using EclipseLink * to create a JsonSchema. * * @see JsonSchemaGenerator * @author mmacivor * */ public class JsonSchema { @XmlElement(name="$schema") private String schemaVersion = "http://json-schema.org/draft-04/schema#"; @XmlElement(name="title") private String title; @XmlElement(name="type") private JsonType type; @XmlElement(name="anyOf") private Property[] anyOf; @XmlElement(name="enumeration") private List enumeration; @XmlVariableNode("name") @XmlElementWrapper(name="properties") private Map properties; @XmlElement(name="items") private Property items; @XmlElement(name="additionalProperties") private Boolean additionalProperties = null; @XmlVariableNode("name") @XmlElementWrapper(name="definitions") private Map definitions; private List required; public void setTitle(String title) { this.title = title; } public void setType(JsonType type) { this.type = type; } public void addProperty(Property property) { this.getProperties().put(property.getName(), property); } public Map getProperties() { if(properties == null) { properties = new LinkedHashMap(); } return properties; } public void setProperties(Map props) { this.properties = props; } public Map getDefinitions() { if(definitions == null) { definitions = new LinkedHashMap(); } return definitions; } public Property getProperty(String name) { if(properties == null) { return null; } return properties.get(name); } public Property getItems() { return items; } public void setItems(Property items) { this.items = items; } public Boolean isAdditionalProperties() { return additionalProperties; } public void setAdditionalProperties(Boolean additionalProperties) { this.additionalProperties = additionalProperties; } public void setAnyOf(Property[] anyOf) { this.anyOf = anyOf; } public Property[] getAnyOf() { return anyOf; } public List getEnumeration() { return enumeration; } public void setEnumeration(List enumeration) { this.enumeration = enumeration; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy