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

com.antiaction.common.json.JSONValue Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
/*
 * JSON library.
 * Copyright 2012-2013 Antiaction (http://antiaction.com/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.antiaction.common.json;

import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;

/**
 * Abstract JSON value base. Implementations should only override the methods
 * which are relevant for their supported value type.
 *
 * @author Nicholas
 * Created on 01/08/2012
 */
public abstract class JSONValue {

	/** Type of the extending instance. */
	public int type;

	/**
	 * Output the JSON value to the given Encoder.
	 * @param encoder output encoder
	 * @throws IOException if an i/o error occurs while encoding
	 */
	public void encode(JSONEncoder encoder) throws IOException {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Output pretty print the JSON value to the given Encoder.
	 * @param encoder output encoder
	 * @throws IOException if an i/o error occurs while encoding
	 */
	public void encode(JSONEncoder encoder, String indentation, String indent) throws IOException {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as an JSONArray or null
	 * @return the JSON value as an JSONArray or null
	 */
	public JSONArray getArray() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as an JSONObject or null
	 * @return the JSON value as an JSONObject or null
	 */
	public JSONObject getObject() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a Boolean or null
	 * @return the JSON value as a Boolean or null
	 */
	public Boolean getBoolean() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a String of null
	 * @return the JSON value as a String of null
	 */
	public String getString() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a Byte array or null
	 * @return the JSON value as a Byte array or null
	 */
	public byte[] getBytes() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as an Integer or null
	 * @return the JSON value as an Integer or null
	 */
	public Integer getInteger() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a Long or null
	 * @return the JSON value as a Long or null
	 */
	public Long getLong() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a Float or null
	 * @return the JSON value as a Float or null
	 */
	public Float getFloat() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a Double or null
	 * @return the JSON value as a Double or null
	 */
	public Double getDouble() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a BigInteger or null
	 * @return the JSON value as a BigInteger or null
	 */
	public BigInteger getBigInteger() {
		throw new UnsupportedOperationException("Unimplemented");
	}

	/**
	 * Returns the JSON value as a BigDecimal or null
	 * @return the JSON value as a BigDecimal or null
	 */
	public BigDecimal getBigDecimal() {
		throw new UnsupportedOperationException("Unimplemented");
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy