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

com.sap.cloud.sdk.service.csn2jpa.cds.model.CdsContext Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package com.sap.cloud.sdk.service.csn2jpa.cds.model;

public class CdsContext extends CdsAnnotatable {
	public static final CdsContext DEFAULT_CONTEXT = new CdsContext(null);
	private final String name;
	private CdsContext parent;

	public CdsContext(String name) {
		this.name = name;
	}

	public String getCanonicalName() {
		return name;
	}

	public String getName() {
		if (name != null) {
			return name.substring(name.lastIndexOf('.') + 1);
		}
		return name;
	}

	public String getPath() {
		if (name != null && name.contains(".")) {
			return name.substring(0, name.lastIndexOf('.'));
		}
		return "";
	}

	public void setParent(CdsContext parent) {
		this.parent = parent;
	}

	public CdsContext getParent() {
		return parent;
	}

	@Override
	public void accept(CdsVisitor visitor) {
		visitor.visit(this);
	}

	@Override
	public String toString() {
		return name;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy