/** * Create a new expanded name. * * @param namespaceURI * the name of the namespace this EName belongs to. If set to {@link javax.xml.XMLConstants#NULL_NS_URI}, * this name does not belong to any namespace. Use this option with care. * @param localName * the local part of the name. Must not be empty. */ public EName(String namespaceURI, String localName) { RequireUtil.notNull(namespaceURI, "namespaceURI"); RequireUtil.notEmpty(localName, "localName"); this.namespaceURI = namespaceURI; this.localName = localName; }
public VCell(A a, boolean stable) { this.a = notNull(a, "a"); this.stable = stable; change = 1; }
/** * Bind a prefix to a namespace URI (namespace name). * * @param prefix a prefix or the empty string ({@link javax.xml.XMLConstants#DEFAULT_NS_PREFIX}) to bind * the default namespace * @param namespaceURI Either a URI or the empty string ({@link javax.xml.XMLConstants#NULL_NS_URI}). * See <a href="http://www.w3.org/TR/REC-xml-names/#ns-decl">Declaring Namespaces</a> * for details about namespace declarations. */ public XmlNamespaceBinding(String prefix, String namespaceURI) { this.prefix = RequireUtil.notNull(prefix, "prefix"); this.namespaceURI = RequireUtil.notNull(namespaceURI, "namespaceURI"); }
/** * Create a new Dublin Core value. * * @param value * the value * @param language * the language (two letter ISO 639) * @param encodingScheme * the encoding scheme used to encode the value */ public DublinCoreValue(String value, String language, Opt<EName> encodingScheme) { this.value = RequireUtil.notNull(value, "value"); this.language = RequireUtil.notNull(language, "language"); this.encodingScheme = RequireUtil.notNull(encodingScheme, "encodingScheme"); }
@Override public void add(EName property, String value, String language) { RequireUtil.notNull(property, "property"); RequireUtil.notNull(value, "value"); if (language == null || LANGUAGE_ANY.equals(language)) throw new IllegalArgumentException("Language code may not be null or LANGUAGE_ANY"); add(property, value, language, null); }
@Override public void remove(EName property) { RequireUtil.notNull(property, "property"); removeValue(property, LANGUAGE_ANY); }
@Override public boolean hasValue(EName property) { RequireUtil.notNull(property, "property"); return hasPropertyValue(property, LANGUAGE_ANY); }
@Override public void set(EName property, String value) { RequireUtil.notNull(property, "property"); setValue(property, value, LANGUAGE_UNDEFINED, null); }
@Override public boolean hasMultipleValues(EName property) { RequireUtil.notNull(property, "property"); return hasMultiplePropertyValues(property, LANGUAGE_ANY); }
@Override public void set(EName property, @Nullable String value, String language) { RequireUtil.notNull(property, "property"); if (language == null || LANGUAGE_ANY.equals(language)) throw new IllegalArgumentException("Language code may not be null or LANGUAGE_ANY"); setValue(property, value, language, null); }
/** * Adds the element with the <code>xml:lang</code> attribute to the metadata collection. * * @param element * the expanded name of the element * @param value * the value * @param language * the language identifier (two letter ISO 639) */ protected void addLocalizedElement(EName element, String value, String language) { RequireUtil.notNull(element, "expanded name"); RequireUtil.notNull(language, "language"); Map<EName, String> attributes = new HashMap<>(1); attributes.put(XML_LANG_ATTR, language); addElement(new CatalogEntry(element, value, attributes)); }