net.fortuna.ical4j.model.Property类的使用及代码示例

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

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

Property介绍

[英]Defines an iCalendar property. Subclasses of this class provide additional validation and typed values for specific iCalendar properties.

Note that subclasses must provide a reference to the factory used to create the property to support property cloning (copy). If no factory is specified an UnsupportedOperationException will be thrown by the #copy() method.
[中]定义iCalendar属性。此类的子类为特定iCalendar属性提供额外的验证和类型化值。
请注意,子类必须提供对用于创建属性的工厂的引用,以支持属性克隆(复制)。如果未指定工厂,#copy()方法将引发UnsupportedOperationException。

代码示例

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

/**
 * {@inheritDoc}
 */
public final boolean equals(final Object arg0) {
  if (arg0 instanceof Property) {
    final Property p = (Property) arg0;
    return getName().equals(p.getName())
        && new EqualsBuilder().append(getValue(), p.getValue()).append(getParameters(), p.getParameters()).isEquals();
  }
  return super.equals(arg0);
}

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

private static String getTzid(final Property p) {
 TzId tzidParam = (TzId)p.getParameter(Parameter.TZID);
 if (tzidParam == null) {
  return null;
 }
 return tzidParam.getValue();
}

代码示例来源: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: net.oneandone.cosmo/cosmo-core

/**
 * 
 * @param property The property.
 * @param buffer The string buffer.
 */
private void chompPropertyValue(Property property, StringBuilder buffer) {
  buffer.append(property.getName()).
    append(property.getParameters()).
    append(':').
    append("\n");
}

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

/**
   * {@inheritDoc}
   */
  public final boolean test(final Component component) {
    boolean match = false;
    final PropertyList<Property> properties = component.getProperties(property.getName());
    for (final Property p : properties) {
      if (matchEquals && property.equals(p)) {
        match = true;
      }
      else if (property.getValue().equals(p.getValue())) {
        match = true;
      }
    }
    return match;
  }
}

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

/**
 * @param comp
 * @param name
 * @return String
 */
public static String getPropertyVal(final Component comp, final String name) {
 Property prop =  getProperty(comp, name);
 if (prop == null) {
  return null;
 }
 return prop.getValue();
}

代码示例来源: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")));
}

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

protected static void setPartyIdFromUrl(Property property, Map<String, Object> context) {
  Map<String, ? extends Object> serviceMap = UtilMisc.toMap("address", property.getValue(), "caseInsensitive", "Y");
  Map<String, Object> resultMap = invokeService("findPartyFromEmailAddress", serviceMap, context);
  String partyId = (String) resultMap.get("partyId");
  if (partyId != null) {
    replaceParameter(property.getParameters(), toXParameter(partyIdXParamName, partyId));
  }
}

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

/**
 * Test deep copy of properties.
 */
public void testCopy() throws IOException, URISyntaxException,
    ParseException {
  Property copy = property.copy();
  assertEquals(property, copy);
  copy.getParameters().add(Value.BOOLEAN);
  assertFalse(property.equals(copy));
  assertFalse(copy.equals(property));
}

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

/**
 * Convenience method for retrieving a list of named parameters.
 *
 * @param name name of parameters to retrieve
 * @return a parameter list containing only parameters with the specified name
 */
public final ParameterList getParameters(final String name) {
  return getParameters().getParameters(name);
}

代码示例来源:origin: net.oneandone.cosmo/cosmo-core

private void fixDateTimeProperties(Component component) {
  PropertyList<Property> props = component.getProperties();
  for(Property prop : props) {
    if(prop instanceof DateProperty || prop instanceof DateListProperty) {
      Value v = (Value) prop.getParameter(Parameter.VALUE);
      if(Value.DATE_TIME.equals(v)) {
        prop.getParameters().remove(v);
      }
    }
  }
}

代码示例来源: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: ical4j/ical4j

/**
 * Invoke validation on the component properties in its current state.
 *
 * @throws ValidationException where any of the component properties is not in a valid state
 */
protected final void validateProperties() throws ValidationException {
  for (final Property property : getProperties()) {
    property.validate();
  }
}

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

/**
 * Indicates whether this property is a calendar property.
 * @return boolean
 */
public boolean isCalendarProperty() {
  return PRODID.equalsIgnoreCase(getName())
      || VERSION.equalsIgnoreCase(getName())
      || CALSCALE.equalsIgnoreCase(getName())
      || METHOD.equalsIgnoreCase(getName());
}

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

/**
 * Creates a deep copy of the specified property list.
 * @param properties a property list
 * @throws ParseException where property data cannot be parsed
 * @throws IOException where property data cannot be read
 * @throws URISyntaxException where a property contains an invalid URI
 */
public PropertyList(PropertyList properties) throws ParseException, IOException, URISyntaxException {
  super();
  for (Property p : properties) {
    add(p.copy());
  }
}

代码示例来源:origin: net.oneandone.cosmo/cosmo-core

protected VAlarm getDisplayAlarm(VEvent event) {
  ComponentList<VAlarm> alarmsList = event.getAlarms();
  for(VAlarm alarm: alarmsList) {
    if (alarm.getProperties().getProperty(Property.ACTION).equals(
        Action.DISPLAY)) {
      return alarm;
    }
  }
  
  return null;
}

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

/**
   * {@inheritDoc}
   */
  public final boolean match(final Component component) {
    boolean match = false;
    final PropertyList<Property> properties = component.getProperties(property.getName());
    for (final Property p : properties) {
      if (matchEquals && property.equals(p)) {
        match = true;
      }
      else if (property.getValue().equals(p.getValue())) {
        match = true;
      }
    }
    return match;
  }
}

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

private String getPval(String name) {
 Property prop = getProp(name);
 if (prop == null) {
  return null;
 }
 return prop.getValue();
}

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

/**
 * Convenience method for retrieving a single parameter.
 *
 * @param name name of the parameter to retrieve
 * @return the first parameter from the parameter list with the specified name
 */
public final Parameter getParameter(final String name) {
  return getParameters().getParameter(name);
}

代码示例来源:origin: 1and1/cosmo

/**
 * 
 * @param property The property.
 * @param buffer The string buffer.
 */
private void chompPropertyValue(Property property, StringBuilder buffer) {
  buffer.append(property.getName()).
    append(property.getParameters()).
    append(':').
    append("\n");
}

相关文章