blob: 77d03d3a124c91bccfc3cf234a485c6e5b3afbb2 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. 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/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Adding pattern facets to simple types" />
<meta name="abstract" content="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space." />
<meta name="description" content="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space." />
<meta content="XML schema editor, adding, pattern facets, XML schema files, pattern facets, XML schema files" name="DC.subject" />
<meta content="XML schema editor, adding, pattern facets, XML schema files, pattern facets, XML schema files" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/taddsmpt.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="taddreg" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Adding pattern facets to simple types</title>
</head>
<body id="taddreg"><a name="taddreg"><!-- --></a>
<h1 class="topictitle1">Adding pattern facets to simple types</h1>
<div><p>A pattern facet can be used to constrain the value of a type's
lexical space (the set of string literals that represent the values of a type),
which indirectly constrains the value space.</p>
<div class="section"><p> The value of the pattern is called a regular expression. You
can specify it using the <span class="uicontrol">Regular Expression</span> wizard.</p>
<p>To
add a pattern to a simple type, follow these steps:</p>
</div>
<ol>
<li class="stepexpand"><span>In the Graph view, select the simple type you want to work with.</span>
</li>
<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">Constraints</span> tab,
then the <span class="uicontrol">Patterns</span> radio button.</span></li>
<li class="stepexpand"><span>Click <span class="uicontrol">Add...</span>.</span> The Regular Expression
Wizard opens.</li>
<li class="stepexpand"><span>Select the token you want to add to the expression.</span></li>
<li class="stepexpand"><span>Indicate how often you want the token to appear in order for a
match to succeed.</span> If you want the token to repeat, click <span class="uicontrol">Repeat</span> and
specify the number of times the token must appear. If you want to specify
a minimum and maximum number of times the token can appear, click <span class="uicontrol">Range</span> and
enter a minimum and maximum value.</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Add</span> to add the token to the regular
expression.</span></li>
<li class="stepexpand"><span>Repeat the previous three steps as necessary to create the entire
expression.</span></li>
<li class="stepexpand"><span>When you are finished, click <span class="uicontrol">Next</span>.</span>
</li>
<li class="stepexpand"><span>(Optional) Enter some sample text to test against the regular expression
and see if a match occurs. </span></li>
<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
</ol>
<div class="section">The regular expression will appear in the Patterns page.</div>
<div class="section">To edit an existing pattern, select it in the Patterns page and click <span class="uicontrol">Edit</span>.
To delete an existing pattern, select it in the Patterns page and click <span class="uicontrol">Delete</span>. </div>
</div>
<div><div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="../topics/taddsmpt.html" title="Simple types are used to created derived datatypes. They provide a set of constraints on the value space (that is, a set of values) and the lexical space (that is, a set of valid literals) of a datatype.">Adding simple types</a></div>
</div>
</div>
</body>
</html>