blob: f364128d607a07c085a5ba0d292f84a09babf09d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Andras Balogh and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andras Balogh - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.imports.vtml;
import java.util.HashSet;
import org.eclipse.viatra2.core.IEntity;
import org.eclipse.viatra2.core.IModelElement;
import org.eclipse.viatra2.core.IModelSpace;
import org.eclipse.viatra2.errors.VPMCoreException;
/**
* @author babo
*
*/
public class ElementDefinition extends ASTNode {
public String fqn(String ns, String n)
{
if (ns==null) return n;
if (ns.length()==0) return n;
if (n.indexOf('.')>=0) return n;
return ns+"."+n;
}
protected final static String DBUG = "-------------------------------------------------------------------------------------------------------------------------------------------------";
public void printDebug(int i)
{
System.out.println(DBUG.substring(0,i)+getFQN());
for (RelationDefinition e : relations)
{
e.printDebug(i+3);
}
}
HashSet<RelationDefinition> relations = new HashSet<RelationDefinition>();
/**
* @return Returns the relations.
*/
public HashSet<RelationDefinition> getRelations() {
return relations;
}
public IModelElement getElement(){
return null;
}
boolean processed = false;
public String getFQN()
{
return "";
}
public void addRelation(RelationDefinition r)
{
r.setNamespace(getFQN());
r.setSource(getFQN());
relations.add(r);
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.imports.vtcl.ASTNode#checkDefintion(org.eclipse.viatra2.imports.vtcl.ASTBuilder, org.eclipse.viatra2.core.IModelSpace)
*/
public boolean checkDefintion(ASTBuilder ab, IModelSpace m) {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.imports.vtcl.ASTNode#generateElements(org.eclipse.viatra2.imports.vtcl.ASTBuilder, org.eclipse.viatra2.core.IModelSpace, org.eclipse.viatra2.core.IEntity)
*/
public void generateElements(ASTBuilder ab, IModelSpace m, IEntity temp)
throws VPMCoreException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.imports.vtcl.ASTNode#resolveReferences(org.eclipse.viatra2.imports.vtcl.ASTBuilder)
*/
public void resolveReferences(ASTBuilder ab) throws VPMCoreException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.imports.vtcl.ASTNode#updateModelspace(org.eclipse.viatra2.imports.vtcl.ASTBuilder, org.eclipse.viatra2.core.IModelSpace)
*/
public void updateModelspace(ASTBuilder ab, IModelSpace m)
throws VPMCoreException {
// TODO Auto-generated method stub
}
/**
* @return Returns the processed.
*/
public boolean isProcessed() {
return processed;
}
/**
* @param processed The processed to set.
*/
public void setProcessed(boolean processed) {
this.processed = processed;
}
}