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

org.umlg.java.metamodel.annotation.OJEnumValue Maven / Gradle / Ivy

There is a newer version: 2.0.15
Show newest version
package org.umlg.java.metamodel.annotation;

import java.util.Set;

import org.umlg.java.metamodel.OJElement;
import org.umlg.java.metamodel.OJPathName;

/**
 * A class representing the invocation of a Enum literal, typically from an annotation attribute value.
 * 
 * @author ampie
 * 
 */
public class OJEnumValue extends OJElement{
	private OJPathName type;
	private String literalName;

	public OJEnumValue(OJPathName type,String literalName){
		super();
		this.type = type;
		this.literalName = literalName;
	}
	public String getLiteralName(){
		return this.literalName;
	}
	public void setLiteralName(String literalName){
		this.literalName = literalName;
	}
	public OJPathName getType(){
		return this.type;
	}
	public void setType(OJPathName type){
		this.type = type;
	}
	@Override
	public String toJavaString(){
		// Outing the fully qualified name here to avoid potential name clashes
		return this.type.toJavaString() + "." + this.literalName;
	}
	@Override
	public void renameAll(Set match,String suffix){
		if(getType() != null){
			getType().renameAll(match, suffix);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy