Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly/metamodel
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15719/src/ccmtools/parser/assembly/metamodel
Modified Files:
ModelElement.java Model.java
Log Message:
Java assemblies
Index: ModelElement.java
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly/metamodel/ModelElement.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ModelElement.java 14 Feb 2007 12:27:05 -0000 1.4
--- ModelElement.java 15 Feb 2007 13:18:37 -0000 1.5
***************
*** 18,23 ****
public abstract class ModelElement
{
- public static final String IDL_SCOPE = "::";
-
protected String name_;
--- 18,21 ----
***************
*** 25,29 ****
{
name_ = name;
! if (name.indexOf(IDL_SCOPE) >= 0)
throw new RuntimeException("scoped name!");
}
--- 23,27 ----
{
name_ = name;
! if (name.indexOf(Model.IDL_SCOPE) >= 0)
throw new RuntimeException("scoped name!");
}
***************
*** 45,53 ****
if (parent_ != null)
{
! return parent_.getGlobalName() + IDL_SCOPE + name_;
}
else
{
! return IDL_SCOPE + name_;
}
}
--- 43,51 ----
if (parent_ != null)
{
! return parent_.getGlobalName() + Model.IDL_SCOPE + name_;
}
else
{
! return Model.IDL_SCOPE + name_;
}
}
Index: Model.java
===================================================================
RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly/metamodel/Model.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Model.java 14 Feb 2007 12:27:05 -0000 1.5
--- Model.java 15 Feb 2007 13:18:37 -0000 1.6
***************
*** 19,22 ****
--- 19,24 ----
public class Model
{
+ public static final String IDL_SCOPE = "::";
+
private Vector<ModelElement> elements_ = new Vector<ModelElement>();
***************
*** 75,77 ****
--- 77,92 ----
}
}
+
+ /**
+ * searches for an assembly description
+ *
+ * @param key qualified IDL name of the component
+ * @return the assembly description (or null)
+ */
+ public Assembly getAssembly( String key )
+ {
+ if (!key.startsWith(IDL_SCOPE))
+ key = IDL_SCOPE + key;
+ return assemblies_.get(key);
+ }
}
|