本文整理汇总了Java中com.sun.tools.corba.se.idl.constExpr.Expression类的典型用法代码示例。如果您正苦于以下问题:Java Expression类的具体用法?Java Expression怎么用?Java Expression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Expression类属于com.sun.tools.corba.se.idl.constExpr包,在下文中一共展示了Expression类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeType
import com.sun.tools.corba.se.idl.constExpr.Expression; //导入依赖的package包/类
/**
*
**/
private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream)
{
if (type instanceof PrimitiveEntry)
{
// RJB does something have to be done with TC offsets?
if (type.name ().equals ("long long"))
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));");
else if (type.name ().equals ("unsigned short"))
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));");
else if (type.name ().equals ("unsigned long"))
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));");
else if (type.name ().equals ("unsigned long long"))
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));");
else
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
}
else if (type instanceof StringEntry)
{
StringEntry s = (StringEntry)type;
Expression e = s.maxSize ();
if (e == null)
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
else
stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
}
else
stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // <d61056>
}
示例2: type
import com.sun.tools.corba.se.idl.constExpr.Expression; //导入依赖的package包/类
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
int offsetOfType = tcoffsets.offset (entry.type ().fullName ());
if (offsetOfType >= 0)
{
// This is a recursive sequence
tcoffsets.set (null);
// Need to fix later: how to get repositoryId of IDL type containing this sequence?
// entry.repositoryID().ID() returns empty string and
// Util.javaQualifiedName(entry) returns internal name which is not valid repId
stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_recursive_tc (" + "\"\"" + ");");
tcoffsets.bumpCurrentOffset (4); // add indirection field
}
else
{
// This is a normal sequence
tcoffsets.set (entry);
index = ((JavaGenerator)entry.type ().generator ()).type (index + 1, indent, tcoffsets, name, entry.type (), stream);
Expression maxSize = ((SequenceEntry)entry).maxSize ();
if (maxSize == null)
stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (0, " + name + ");");
else
stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (" + Util.parseExpression (maxSize) + ", " + name + ");");
}
//stream.println (indent + name + " = " + Util.helperName (entry, true) + ".type ();"); // <d61056>
return index;
}
示例3: vectorizeLabels
import com.sun.tools.corba.se.idl.constExpr.Expression; //导入依赖的package包/类
/**
*
**/
private Vector vectorizeLabels (Vector branchVector, boolean useIntsForEnums )
{
Vector mergedLabels = new Vector ();
Enumeration branches = branchVector.elements ();
while (branches.hasMoreElements ())
{
UnionBranch branch = (UnionBranch)branches.nextElement ();
Enumeration labels = branch.labels.elements ();
while (labels.hasMoreElements ())
{
Expression expr = (Expression)labels.nextElement ();
String str ;
if (unionIsEnum)
if (useIntsForEnums)
str = typePackage + "_" + Util.parseExpression( expr ) ;
else
str = typePackage + Util.parseExpression( expr ) ;
else
str = Util.parseExpression( expr ) ;
mergedLabels.addElement (str);
}
}
return mergedLabels;
}
示例4: writeNonBoolean
import com.sun.tools.corba.se.idl.constExpr.Expression; //导入依赖的package包/类
/**
*
**/
private int writeNonBoolean (String disName, int index, String indent, String name, UnionEntry u, PrintWriter stream)
{
SymtabEntry utype = Util.typeOf (u.type ());
if (utype instanceof EnumEntry)
stream.println (indent + "switch (" + name + ".discriminator ().value ())");
else
stream.println (indent + "switch (" + name + ".discriminator ())");
stream.println (indent + "{");
String typePackage = Util.javaQualifiedName (utype) + '.';
Enumeration e = u.branches ().elements ();
while (e.hasMoreElements ())
{
UnionBranch branch = (UnionBranch)e.nextElement ();
Enumeration labels = branch.labels.elements ();
while (labels.hasMoreElements ())
{
Expression label = (Expression)labels.nextElement ();
if (utype instanceof EnumEntry)
{
String key = Util.parseExpression (label);
stream.println (indent + " case " + typePackage + '_' + key + ":");
}
else
stream.println (indent + " case " + cast (label, utype) + ':');
}
if (!branch.typedef.equals (u.defaultBranch ()))
{
index = writeBranch (index, indent + " ", name, branch.typedef, stream);
stream.println (indent + " break;");
}
}
if (u.defaultBranch () != null) {
stream.println (indent + " default:");
index = writeBranch (index, indent + " ", name, u.defaultBranch (), stream);
stream.println (indent + " break;");
}
stream.println (indent + "}");
return index;
}
示例5: has
import com.sun.tools.corba.se.idl.constExpr.Expression; //导入依赖的package包/类
boolean has (Expression label)
{
Enumeration eBranches = _branches.elements ();
while (eBranches.hasMoreElements ())
{
Enumeration eLabels = ((UnionBranch)eBranches.nextElement ()).labels.elements ();
while (eLabels.hasMoreElements ())
{
Expression exp = (Expression)eLabels.nextElement ();
if (exp.equals (label) || exp.value ().equals (label.value ()))
return true;
}
}
return false;
}