net.fortuna.ical4j.model.Property.setValue()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(144)

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

Property.setValue介绍

[英]Sets the current value of the property.
[中]设置属性的当前值。

代码示例

代码示例来源:origin: net.oneandone.ical4j/ical4j

/**
 * {@inheritDoc}
 */
public void propertyValue(final String value) throws URISyntaxException,
    ParseException, IOException {
  assertProperty(property);
  if (property instanceof Escapable) {
    property.setValue(Strings.unescape(value));
  } else {
    property.setValue(value);
  }
}

代码示例来源:origin: org.bedework.ical4j/ical4j

/**
 * {@inheritDoc}
 */
public void propertyValue(final String value) throws URISyntaxException,
    ParseException, IOException {
  assertProperty(property);
  if (property instanceof Escapable) {
    property.setValue(Strings.unescape(value));
  } else {
    property.setValue(value);
  }
}

代码示例来源:origin: org.bedework/bw-ical4j-cl

/**
 * {@inheritDoc}
 */
public void propertyValue(final String value) throws URISyntaxException,
    ParseException, IOException {
  assertProperty(property);
  if (property instanceof Escapable) {
    property.setValue(Strings.unescape(value));
  }
  else {
    property.setValue(value);
  }
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-ical

/**
 * {@inheritDoc}
 */
@Override
public void propertyValue(final String value) throws URISyntaxException,
    ParseException, IOException {
  assertProperty(property);
  if (property instanceof Escapable) {
    property.setValue(Strings.unescape(value));
  }
  else {
    property.setValue(value);
  }
}

代码示例来源:origin: apache/ofbiz-framework

protected static void getPartyUrl(Property property, GenericValue partyAssign, Map<String, Object> context) {
  Map<String, ? extends Object> serviceMap = UtilMisc.toMap("partyId", partyAssign.get("partyId"));
  Map<String, Object> resultMap = invokeService("getPartyICalUrl", serviceMap, context);
  String iCalUrl = (String) resultMap.get("iCalUrl");
  if (iCalUrl != null) {
    if (!iCalUrl.contains(":") && iCalUrl.contains("@")) {
      iCalUrl = "MAILTO:".concat(iCalUrl);
    }
    try {
      property.setValue(iCalUrl);
    } catch (Exception e) {
      Debug.logError(e, "Error while setting party URI: ", module);
    }
  }
}

代码示例来源:origin: PrivacyApps/calendar-import-export

private void copyEnumProperty(PropertyList l, String evName, Cursor cur, String dbName,
                   List<String> vals) {
    // None of the exceptions caught below should be able to be thrown AFAICS.
    try {
      int i = getColumnIndex(cur, dbName);
      if (i != -1 && !cur.isNull(i)) {
        int value = (int) cur.getLong(i);
        if (value >= 0 && value < vals.size() && vals.get(value) != null) {
          Property p = mPropertyFactory.createProperty(evName);
          p.setValue(vals.get(value));
          l.add(p);
        }
      }
    } catch (IOException | URISyntaxException | ParseException ignored) {
    }
  }
}

代码示例来源:origin: org.bedework/bw-util2-calendar

/**
 * {@inheritDoc}
 */
@Override
public void propertyValue(final String value) throws URISyntaxException,
    ParseException, IOException {
 assertProperty(bs.getProperty());
 if (bs.getProperty() instanceof Escapable) {
  bs.getProperty().setValue(Strings.unescape(value));
 }
 else {
  bs.getProperty().setValue(value);
 }
}

代码示例来源:origin: PrivacyApps/calendar-import-export

private String copyProperty(PropertyList l, String evName, Cursor cur, String dbName) {
  // None of the exceptions caught below should be able to be thrown AFAICS.
  try {
    String value = getString(cur, dbName);
    if (value != null) {
      Property p = mPropertyFactory.createProperty(evName);
      p.setValue(value);
      l.add(p);
      return value;
    }
  } catch (IOException | URISyntaxException | ParseException ignored) {
  }
  return null;
}

代码示例来源:origin: org.bedework/bw-ical4j-cl

/**
 * Creates a deep copy of the specified property. That is, the name, parameter list, and value are duplicated from
 * the specified property. This constructor should only be called from sub-classes to ensure type integrity is
 * maintained.
 * @param property a property to copy
 * @throws URISyntaxException where the specified property contains an invalid URI value
 * @throws ParseException where the specified property has invalid data
 * @throws IOException where an error occurs reading data from the specified property
 * @deprecated Use {@link #copy()} instead
 */
protected Property(final Property property) throws IOException,
    URISyntaxException, ParseException {
  this(property.getName(), new ParameterList(property.getParameters(), false),
      property.factory);
  setValue(property.getValue());
}

代码示例来源:origin: ical4j/ical4j

/**
 * Creates a deep copy of the specified property. That is, the name, parameter list, and value are duplicated from
 * the specified property. This constructor should only be called from sub-classes to ensure type integrity is
 * maintained.
 *
 * @param property a property to copy
 * @throws URISyntaxException where the specified property contains an invalid URI value
 * @throws ParseException     where the specified property has invalid data
 * @throws IOException        where an error occurs reading data from the specified property
 * @deprecated Use {@link #copy()} instead
 */
protected Property(final Property property) throws IOException,
    URISyntaxException, ParseException {
  this(property.getName(), new ParameterList(property.getParameters(), false),
      property.factory);
  setValue(property.getValue());
}

代码示例来源:origin: org.mnode.ical4j/ical4j

/**
 * Creates a deep copy of the specified property. That is, the name, parameter list, and value are duplicated from
 * the specified property. This constructor should only be called from sub-classes to ensure type integrity is
 * maintained.
 *
 * @param property a property to copy
 * @throws URISyntaxException where the specified property contains an invalid URI value
 * @throws ParseException     where the specified property has invalid data
 * @throws IOException        where an error occurs reading data from the specified property
 * @deprecated Use {@link #copy()} instead
 */
protected Property(final Property property) throws IOException,
    URISyntaxException, ParseException {
  this(property.getName(), new ParameterList(property.getParameters(), false),
      property.factory);
  setValue(property.getValue());
}

代码示例来源:origin: net.oneandone.ical4j/ical4j

/**
 * Creates a deep copy of the specified property. That is, the name, parameter list, and value are duplicated from
 * the specified property. This constructor should only be called from sub-classes to ensure type integrity is
 * maintained.
 *
 * @param property a property to copy
 * @throws URISyntaxException where the specified property contains an invalid URI value
 * @throws ParseException     where the specified property has invalid data
 * @throws IOException        where an error occurs reading data from the specified property
 * @deprecated Use {@link #copy()} instead
 */
protected Property(final Property property) throws IOException,
    URISyntaxException, ParseException {
  this(property.getName(), new ParameterList(property.getParameters(), false),
      property.factory);
  setValue(property.getValue());
}

代码示例来源:origin: org.bedework.ical4j/ical4j

/**
 * Creates a deep copy of the specified property. That is, the name, parameter list, and value are duplicated from
 * the specified property. This constructor should only be called from sub-classes to ensure type integrity is
 * maintained.
 *
 * @param property a property to copy
 * @throws URISyntaxException where the specified property contains an invalid URI value
 * @throws ParseException     where the specified property has invalid data
 * @throws IOException        where an error occurs reading data from the specified property
 * @deprecated Use {@link #copy()} instead
 */
protected Property(final Property property) throws IOException,
    URISyntaxException, ParseException {
  this(property.getName(), new ParameterList(property.getParameters(), false),
      property.factory);
  setValue(property.getValue());
}

代码示例来源:origin: org.mnode.ical4j/ical4j

public Property build() throws ParseException, IOException, URISyntaxException {
    Property property = null;
    for (PropertyFactory factory : factories) {
      if (factory.supports(name)) {
        property = factory.createProperty(parameters, value);
        if (property instanceof Escapable) {
          property.setValue(Strings.unescape(value));
        }
      }
    }

    if (property == null) {
      if (isExperimentalName(name)) {
        return new XProperty(name, parameters, value);
      } else if (allowIllegalNames()) {
        return new XProperty(name, parameters, value);
      } else {
        throw new IllegalArgumentException("Illegal property [" + name + "]");
      }
    }

    return property;
  }
}

代码示例来源:origin: ical4j/ical4j

public Property build() throws ParseException, IOException, URISyntaxException {
    Property property = null;
    for (PropertyFactory factory : factories) {
      if (factory.supports(name)) {
        property = factory.createProperty(parameters, value);
        if (property instanceof Escapable) {
          property.setValue(Strings.unescape(value));
        }
      }
    }

    if (property == null) {
      if (isExperimentalName(name)) {
        return new XProperty(name, parameters, value);
      } else if (allowIllegalNames()) {
        return new XProperty(name, parameters, value);
      } else {
        throw new IllegalArgumentException("Illegal property [" + name + "]");
      }
    }

    return property;
  }
}

代码示例来源:origin: ical4j/ical4j

/**
 * @throws IOException
 * @throws URISyntaxException
 * @throws ParseException
 */
@SuppressWarnings("serial")
public void testImmutable() throws IOException, URISyntaxException, ParseException {
  try {
    property.setValue("");
    fail("UnsupportedOperationException should be thrown");
  }
  catch (UnsupportedOperationException uoe) {
  }
  try {
    property.getParameters().add(new Parameter("name", null) {
      public String getValue() {
        return null;
      }
    });
    fail("UnsupportedOperationException should be thrown");
  }
  catch (UnsupportedOperationException uoe) {
  }
}

代码示例来源:origin: org.bedework/bw-util2-calendar

property.setValue(strDate);
} catch (final ParseException e) {

代码示例来源:origin: org.mnode.ical4j/ical4j

property.setValue(strDate);
} catch (ParseException | URISyntaxException e) {

代码示例来源:origin: ical4j/ical4j

property.setValue(strDate);
} catch (ParseException | URISyntaxException e) {

代码示例来源:origin: apache/ofbiz-framework

protected static void loadPartyAssignment(Property property, GenericValue partyAssign, Map<String, Object> context) {
  getPartyUrl(property, partyAssign, context);
  if (UtilValidate.isEmpty(property.getValue())) {
    try {
      // RFC 2445 4.8.4.1 and 4.8.4.3 Value must be a URL
      property.setValue("MAILTO:ofbiz-test@example.com");
    } catch (Exception e) {
      Debug.logError(e, "Error while setting Property value: ", module);
    }
  }
  ParameterList parameterList = property.getParameters();
  replaceParameter(parameterList, toXParameter(partyIdXParamName, partyAssign.getString("partyId")));
  replaceParameter(parameterList, new Cn(makePartyName(partyAssign)));
  replaceParameter(parameterList, toParticipationStatus(partyAssign.getString("assignmentStatusId")));
}

相关文章