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

com.networknt.oas.model.impl.OpenApiObjectImpl Maven / Gradle / Ivy

There is a newer version: 2.1.38
Show newest version
/*******************************************************************************
 *  Copyright (c) 2017 ModelSolv, Inc. and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *     ModelSolv, Inc. - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.networknt.oas.model.impl;

import com.fasterxml.jackson.databind.JsonNode;
import com.networknt.oas.OpenApi;
import com.networknt.oas.jsonoverlay.*;
import com.networknt.oas.model.OpenApiObject;
//import com.reprezen.swaggerparser.model.OpenApi3;

public abstract class OpenApiObjectImpl> extends PropertiesOverlay
        implements OpenApiObject {

    protected OpenApiObjectImpl(JsonNode json, JsonOverlay parent, ReferenceRegistry refReg) {
        super(json, parent, refReg);
    }

    protected OpenApiObjectImpl(V value, JsonOverlay parent, ReferenceRegistry refReg) {
        super(value, parent, refReg);
    }

    @Override
    public OpenApi3 getModel() {
        IJsonOverlay root = getRoot();
        return root instanceof OpenApi ? (OpenApi3) root : null;
    }

    @Override
    public OpenApiObject getParentObject() {
        IJsonOverlay parent = super.getParent();
        while (parent != null && !(parent instanceof OpenApiObject)) {
            parent = parent.getParent();
        }
        return (OpenApiObject) parent;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy