From: Robert L. <rle...@us...> - 2007-02-23 14:15:41
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly/metamodel In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9857/src/ccmtools/parser/assembly/metamodel Modified Files: Component.java Log Message: using alias names for inner components Index: Component.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/assembly/metamodel/Component.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Component.java 15 Feb 2007 16:46:41 -0000 1.4 --- Component.java 23 Feb 2007 14:15:34 -0000 1.5 *************** *** 18,35 **** public class Component extends AssemblyElement { private QualifiedName idl_name_; private String name_; public Component( QualifiedName idl_name, String name ) { idl_name_ = idl_name; name_ = name; } ! public QualifiedName getCcmName() { return idl_name_; } void postProcessing( Assembly parent, Map<String, Component> components ) --- 18,58 ---- public class Component extends AssemblyElement { + /** + * qualified IDL name of the component + */ private QualifiedName idl_name_; + /** + * name of the instance + */ private String name_; + /** + * the component will be deployed under that name (or null if we have to instantiate the home + * directly) + */ + private String alias_; + public Component( QualifiedName idl_name, String name ) { + this(idl_name, name, null); + } + + public Component( QualifiedName idl_name, String name, String alias ) + { idl_name_ = idl_name; name_ = name; + alias_ = alias; } ! public QualifiedName getCcmName() { return idl_name_; } + + public String getAlias() + { + return alias_; + } void postProcessing( Assembly parent, Map<String, Component> components ) *************** *** 46,50 **** public void prettyPrint( PrintStream out, String offset ) { ! out.println(offset + "component " + idl_name_ + " " + name_ + " ;"); } } --- 69,86 ---- public void prettyPrint( PrintStream out, String offset ) { ! StringBuilder text = new StringBuilder(); ! text.append(offset); ! text.append("component "); ! text.append(idl_name_); ! if (alias_ != null) ! { ! text.append(" alias \""); ! text.append(alias_); ! text.append("\""); ! } ! text.append(" "); ! text.append(name_); ! text.append(" ;"); ! out.println(text.toString()); } } |