*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/eplv10.html
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.yangtools.yang.model.repo.api;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-
+import java.util.regex.Pattern;
import org.opendaylight.yangtools.concepts.Identifier;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.objcache.ObjectCache;
import org.opendaylight.yangtools.objcache.ObjectCacheFactory;
+import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
/**
* YANG Schema source identifier
* </ul>
*
* Source identifier is designated to be carry only necessary information
- * to look-up YANG model source and to be used by {@link AdvancedSchemaSourceProvider}
- * and similar.
+ * to look-up YANG model source and to be used by various SchemaSourceProviders.
*
* <b>Note:</b>On source retrieval layer it is impossible to distinguish
* between YANG module and/or submodule unless source is present.
*/
public static final String NOT_PRESENT_FORMATTED_REVISION = "0000-00-00";
+ /**
+ *
+ * Simplified compiled revision pattern in format YYYY-mm-dd, which checks
+ * only distribution of number elements.
+ * <p>
+ * For checking if supplied string is real date, use {@link SimpleDateFormatUtil}
+ * instead.
+ *
+ */
+ public static final Pattern REVISION_PATTERN = Pattern.compile("\\d\\d\\d\\d-\\d\\d-\\d\\d");
+
+
private static final ObjectCache CACHE = ObjectCacheFactory.getObjectCache(SourceIdentifier.class);
private static final long serialVersionUID = 1L;
private final String revision;
* Where revision is date in format YYYY-mm-dd.
* <p>
*
- * @see http://tools.ietf.org/html/rfc6020#section-5.2
+ * @see <a href="http://tools.ietf.org/html/rfc6020#section-5.2">RFC6020</a>
*
* @return Filename for this source identifier.
*/