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

io.apicurio.datamodels.asyncapi.models.AaiHeaderItem Maven / Gradle / Ivy

There is a newer version: 3.5.0.Final
Show newest version
package io.apicurio.datamodels.asyncapi.models;

import io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor;
import io.apicurio.datamodels.core.models.ExtensibleNode;
import io.apicurio.datamodels.core.models.IReferenceNode;
import io.apicurio.datamodels.core.models.Node;
import io.apicurio.datamodels.core.visitors.IVisitor;

/**
 * Represents `Schema Object | Reference Object` type.
 *
 * @author Jakub Senko 
 */
public abstract class AaiHeaderItem extends ExtensibleNode implements IReferenceNode {

    public String $ref;

    /**
     * We do not support deserialization of `Schema Object` yet.
     * In TypeScript, this field contains the raw JS object, in case of Java
     * it is a {@link com.fasterxml.jackson.databind.node.ObjectNode}.
     *
     * @see AsyncAPI 2.0.0 spec
     */
    public Object _schemaRaw;
    
    /**
     * Constructor.
     */
    public AaiHeaderItem() {
    }

    /**
     * Constructor.
     * @param parent
     */
    public AaiHeaderItem(Node parent) {
        if(parent != null) {
            this._parent = parent;
            this._ownerDocument = parent.ownerDocument();
        }
    }

    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     */
    @Override
    public void accept(IVisitor visitor) {
        IAaiVisitor v = (IAaiVisitor) visitor;
        v.visitHeaderItem(this);
    }

    @Override
    public String getReference() {
        return $ref;
    }

    @Override
    public void setReference(String reference) {
        $ref = reference;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy