getProperty

CDocBuilderValue getProperty(String name);

Returns a property of the CDocBuilderValue object.

Please note, that for the .docbuilder file the CDocBuilderValue.getProperty method is not used.

Parameters

NameTypeDescription
nameStringThe name of the CDocBuilderValue object property.

Example

Java

CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
CDocBuilderContext context = builder.getContext();
CDocBuilderValue global = context.getGlobal();
CDocBuilderValue api = global.get("Api");
CDocBuilderValue document = api.call("GetDocument");
CDocBuilderValue docPr = document.getProperty("color");
CDocBuilder.dispose();

There are two more ways to get a property of the CDocBuilderValue object:

  1. use the get method that takes an argument in the string format:

    CDocBuilderValue get(String name);
    

    Example

    Java

    CDocBuilder.initialize("");
    CDocBuilder builder = new CDocBuilder();
    CDocBuilderContext context = builder.getContext();
    CDocBuilderValue global = context.getGlobal();
    CDocBuilderValue api = global.get("Api");
    CDocBuilderValue document = api.call("GetDocument");
    CDocBuilderValue docPr = document.get("color");
    CDocBuilder.dispose();
    
  2. use the default[] postfix expression that takes an argument in the string format:

    property CDocBuilderValue default[String]
    

    Example

    Java

    CDocBuilder.initialize("");
    CDocBuilder builder = new CDocBuilder();
    CDocBuilderContext context = builder.getContext();
    CDocBuilderValue global = context.getGlobal();
    CDocBuilderValue api = global.get("Api");
    CDocBuilderValue document = api.call("GetDocument");
    CDocBuilderValue docPr = document["color"];
    CDocBuilder.dispose();
    

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).