com.sun.star.uno.Any.getObject()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(190)

本文整理了Java中com.sun.star.uno.Any.getObject()方法的一些代码示例,展示了Any.getObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Any.getObject()方法的具体详情如下:
包路径:com.sun.star.uno.Any
类名称:Any
方法名:getObject

Any.getObject介绍

[英]Gets the value within the any.
[中]获取any中的值。

代码示例

代码示例来源:origin: com.haulmont.yarg/yarg

public static XTextTable getTableByName(XComponent xComponent, String tableName) throws NoSuchElementException, WrappedTargetException {
  XNameAccess tables = as(XTextTablesSupplier.class, xComponent).getTextTables();
  return (XTextTable) ((Any) tables.getByName(tableName)).getObject();
}

代码示例来源:origin: cuba-platform/yarg

public static XTextTable getTableByName(XComponent xComponent, String tableName) throws NoSuchElementException, WrappedTargetException {
  XNameAccess tables = as(XTextTablesSupplier.class, xComponent).getTextTables();
  return (XTextTable) ((Any) tables.getByName(tableName)).getObject();
}

代码示例来源:origin: org.openoffice/jurt

private void writeAnyValue(Object value) {
  TypeDescription type;
  if (value == null || value instanceof XInterface) {
    type = TypeDescription.getTypeDescription(XInterface.class);
  } else if (value instanceof Any) {
    Any any = (Any) value;
    try {
      type = TypeDescription.getTypeDescription(any.getType());
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e.toString());
    }
    value = any.getObject();
  } else if (value.getClass() == Object.class) {
    // Avoid StackOverflowError:
    throw new IllegalArgumentException(
      "Object instance does not represent UNO value");
  } else {
    type = TypeDescription.getTypeDescription(value.getClass());
  }
  writeType(type);
  writeValue(type, value);
}

代码示例来源:origin: org.libreoffice/jurt

private void writeAnyValue(Object value) throws ClassNotFoundException {
  TypeDescription type;
  if (value == null || value instanceof XInterface) {
    type = TypeDescription.getTypeDescription(XInterface.class);
  } else if (value instanceof Any) {
    Any any = (Any) value;
    type = TypeDescription.getTypeDescription(any.getType());
    value = any.getObject();
  } else if (value.getClass() == Object.class) {
    // Avoid StackOverflowError:
    throw new IllegalArgumentException(
      "Object instance does not represent UNO value");
  } else {
    type = TypeDescription.getTypeDescription(value.getClass());
  }
  writeType(type);
  writeValue(type, value);
}

代码示例来源:origin: org.openoffice/juh

if (obj == null || (obj instanceof Any && ((Any) obj).getObject() == null))
  retVal= null;
else if(cl.equals(Object.class))
    obj= ((Any) obj).getObject();
  retVal= obj;

代码示例来源:origin: org.libreoffice/juh

if (obj == null || (obj instanceof Any && ((Any) obj).getObject() == null))
{}
else if(cl.equals(Object.class))
    obj= ((Any) obj).getObject();
  retVal= obj;

代码示例来源:origin: org.openoffice/ridl

Any a = (Any) object;
if (a.getType().getTypeClass() == TypeClass.INTERFACE) {
  object = a.getObject();
  Any a = (Any) object;
  object = a.getType().getTypeClass() == TypeClass.INTERFACE
    ? a.getObject() : null;

代码示例来源:origin: org.libreoffice/ridl

Any a = (Any) object;
if (a.getType().getTypeClass() == TypeClass.INTERFACE) {
  object = a.getObject();
  Any a = (Any) object;
  object = a.getType().getTypeClass() == TypeClass.INTERFACE
    ? a.getObject() : null;

代码示例来源:origin: org.libreoffice/jurt

object = a.getObject();
type = a.getType();

代码示例来源:origin: org.openoffice/jurt

object = a.getObject();
type = a.getType();

代码示例来源:origin: org.openoffice/jurt

/** Determines the type of an any object.
  @param object any object
  @return type object
*/
static public Type getType( Object object )
{
  Type t;
  if (null == object)
  {
    t = m_XInterface_type;
  }
  else if (object instanceof Any)
  {
    t = ((Any)object).getType();
    // nested any
    if (TypeClass.ANY_value == t.getTypeClass().getValue())
      return getType( ((Any)object).getObject() );
  }
  else
  {
    t = new Type( object.getClass() );
  }
  return t;
}

代码示例来源:origin: org.libreoffice/jurt

/**
 * Determines the type of an any object.
 *
 * @param object any object.
 * @return type object.
 */
public static Type getType( Object object )
{
  Type t;
  if (null == object)
  {
    t = m_XInterface_type;
  }
  else if (object instanceof Any)
  {
    t = ((Any)object).getType();
    // nested any
    if (TypeClass.ANY_value == t.getTypeClass().getValue())
      return getType( ((Any)object).getObject() );
  }
  else
  {
    t = new Type( object.getClass() );
  }
  return t;
}

代码示例来源:origin: org.openoffice/ridl

return false;
Object v1 = a1.getObject();
Object v2 = a2.getObject();
switch (t.getTypeClass().getValue()) {
case TypeClass.VOID_value:

代码示例来源:origin: org.libreoffice/ridl

return false;
Object v1 = a1.getObject();
Object v2 = a2.getObject();
switch (t.getTypeClass().getValue()) {
case TypeClass.VOID_value:

代码示例来源:origin: org.libreoffice/jurt

Any a = (Any) result;
if (a.getType().getTypeClass() == TypeClass.INTERFACE) {
  result = a.getObject();
} else {

代码示例来源:origin: org.openoffice/jurt

Any a = (Any) result;
if (a.getType().getTypeClass() == TypeClass.INTERFACE) {
  result = a.getObject();
} else {

代码示例来源:origin: org.openoffice/juh

bVoidValue= ((Any) value).getObject() == null;
else
  bVoidValue= value == null;
  bValueOk= checkType(((Any) value).getObject());
else
  bValueOk= checkType(value);

代码示例来源:origin: org.libreoffice/juh

bVoidValue= ((Any) value).getObject() == null;
else
  bVoidValue= value == null;
  bValueOk= checkType(((Any) value).getObject());
else
  bValueOk= checkType(value);

代码示例来源:origin: org.libreoffice/juh

boolean bAnyVal= setVal instanceof Any;
if (bAnyVal)
  bVoidValue= ((Any) setVal).getObject() == null;
else
  bVoidValue= setVal == null;

代码示例来源:origin: org.openoffice/juh

boolean bAnyVal= setVal instanceof Any;
if (bAnyVal)
  bVoidValue= ((Any) setVal).getObject() == null;
else
  bVoidValue= setVal == null;

相关文章