All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thaiopensource.validate.StringPropertyId Maven / Gradle / Ivy

Go to download

A branch of Jing used by the Nu Html Checker. (Jing is a tool for validating documents against RelaxNG schemas.)

The newest version!
package com.thaiopensource.validate;

import com.thaiopensource.util.PropertyId;
import com.thaiopensource.util.PropertyMap;
import com.thaiopensource.util.PropertyMapBuilder;

/**
 * A PropertyId whose value is constrained to be an instance of
 * String.
 *
 * @see String
 */

public class StringPropertyId extends PropertyId {
   public StringPropertyId(String name) {
      super(name, String.class);
    }

  /**
   * Returns the value of the property.  This is a typesafe
   * version of PropertyMap.get.
   *
   * @param properties the PropertyMap to be used
   * @return the String to which the PropertyMap maps this PropertyId,
   * or null if this PropertyId is not in the PropertyMap
   * @see com.thaiopensource.util.PropertyMap#get
   */
  public String get(PropertyMap properties) {
    return (String)properties.get(this);
  }

  /**
   * Sets the value of the property. Modifies the PropertyMapBuilder
   * so that this PropertyId is mapped to the specified value. This
   * is a typesafe version of PropertyMapBuilder.put.
   *
   * @param builder the PropertyMapBuilder to be modified
   * @param value the String to which this PropertyId is to be mapped
   * @return the String to which this PropertyId was mapped before,
   * or null if it was not mapped
   *
   * @see com.thaiopensource.util.PropertyMapBuilder#put
   */
  public String put(PropertyMapBuilder builder, String value) {
    return (String)builder.put(this, value);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy