org.pkl.core.PClassInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pkl-tools Show documentation
Show all versions of pkl-tools Show documentation
Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.
/*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
*
* 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
*
* https://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 org.pkl.core;
import static java.util.Map.*;
import java.io.Serial;
import java.io.Serializable;
import java.net.URI;
import java.util.*;
import java.util.regex.Pattern;
import org.pkl.core.util.Nullable;
/** Information about a Pkl class and its Java representation. */
@SuppressWarnings("rawtypes")
public final class PClassInfo implements Serializable {
@Serial private static final long serialVersionUID = 0L;
// Simple name of a module's class.
// User-facing via `module.getClass()` and error messages.
// "Module" would result in a name clash between
// the module class of `pkl.base` and class `Module` defined in `pkl.base`.
public static final String MODULE_CLASS_NAME = "ModuleClass";
public static final URI pklBaseUri = URI.create("pkl:base");
public static final URI pklSemverUri = URI.create("pkl:semver");
public static final URI pklSettingsUri = URI.create("pkl:settings");
public static final URI pklProjectUri = URI.create("pkl:Project");
public static final PClassInfo Any = pklBaseClassInfo("Any", Void.class);
public static final PClassInfo Null = pklBaseClassInfo("Null", PNull.class);
public static final PClassInfo String = pklBaseClassInfo("String", String.class);
public static final PClassInfo Boolean = pklBaseClassInfo("Boolean", boolean.class);
public static final PClassInfo Number = pklBaseClassInfo("Number", Void.class);
public static final PClassInfo Int = pklBaseClassInfo("Int", long.class);
public static final PClassInfo Float = pklBaseClassInfo("Float", double.class);
public static final PClassInfo Duration = pklBaseClassInfo("Duration", Duration.class);
public static final PClassInfo DataSize = pklBaseClassInfo("DataSize", DataSize.class);
public static final PClassInfo Pair = pklBaseClassInfo("Pair", Pair.class);
public static final PClassInfo Collection = pklBaseClassInfo("Collection", Void.class);
public static final PClassInfo List = pklBaseClassInfo("List", ArrayList.class);
public static final PClassInfo Set = pklBaseClassInfo("Set", LinkedHashSet.class);
public static final PClassInfo Map = pklBaseClassInfo("Map", LinkedHashMap.class);
public static final PClassInfo Object = pklBaseClassInfo("Object", PObject.class);
public static final PClassInfo Dynamic = pklBaseClassInfo("Dynamic", PObject.class);
public static final PClassInfo Typed = pklBaseClassInfo("Typed", PObject.class);
public static final PClassInfo Listing = pklBaseClassInfo("Listing", ArrayList.class);
public static final PClassInfo Mapping =
pklBaseClassInfo("Mapping", LinkedHashMap.class);
public static final PClassInfo Module = pklBaseClassInfo("Module", PModule.class);
public static final PClassInfo ModuleOutput =
pklBaseClassInfo("ModuleOutput", PObject.class);
public static final PClassInfo Class = pklBaseClassInfo("Class", PClass.class);
public static final PClassInfo TypeAlias =
pklBaseClassInfo("TypeAlias", TypeAlias.class);
public static final PClassInfo Regex = pklBaseClassInfo("Regex", Pattern.class);
public static final PClassInfo Deprecated =
pklBaseClassInfo("Deprecated", PObject.class);
public static final PClassInfo AlsoKnownAs =
pklBaseClassInfo("AlsoKnownAs", PObject.class);
public static final PClassInfo Unlisted = pklBaseClassInfo("Unlisted", PObject.class);
public static final PClassInfo DocExample =
pklBaseClassInfo("DocExample", PObject.class);
public static final PClassInfo PcfRenderDirective =
pklBaseClassInfo("PcfRenderDirective", PObject.class);
public static final PClassInfo ModuleInfo =
pklBaseClassInfo("ModuleInfo", PObject.class);
public static final PClassInfo Version =
new PClassInfo<>("pkl.semver", "Version", PObject.class, pklSemverUri);
public static final PClassInfo Project =
new PClassInfo<>("pkl.Project", "ModuleClass", PObject.class, pklProjectUri);
public static final PClassInfo Settings =
new PClassInfo<>("pkl.settings", "ModuleClass", PObject.class, pklSettingsUri);
public static final PClassInfo
© 2015 - 2024 Weber Informatics LLC | Privacy Policy