validate RNA simple notation

@param polymerNotation notation to be checked
@return true if the polymyer notation is valid, otherwise throws an exception
@throws org.helm.notation2.parser.exceptionparser.NotationException if notation is not valid
775182
public static boolean validateSimpleNotationForRNA(String polymerNotation) throws org.helm.notation2.parser.exceptionparser.NotationException {
    getMonomerIDListFromNucleotide(polymerNotation);
    return true;
  }
1150295
public boolean isSameType(Monomer m) {
    String analog1 = getNaturalAnalog();
    if (null == analog1) {
      analog1 = getAlternateId();
    }
    String analog2 = m.getNaturalAnalog();
    if (null == analog2) {
      analog2 = m.getAlternateId();
    }
    if (getMonomerType().equals(m.getMonomerType())
        && getPolymerType().equals(m.getPolymerType())
        && analog1.equals(analog2)) {
      return true;
    } else {
      return false;
    }
  }
798026
private HELM2Notation readNotation(String notation)
			throws ParserException, JDOMException, IOException, MonomerException, ChemistryException {
		/* xhelm notation */
		if (notation.contains("<Xhelm>")) {
			LOG.info("xhelm is used as input");
			String xhelm = notation;
			Element xHELMRootElement = getXHELMRootElement(xhelm);

			notation = xHelmNotationParser.getHELMNotationString(xHELMRootElement);
			MonomerStore store = xHelmNotationParser.getMonomerStore(xHELMRootElement);
			updateMonomerStore(store);

		}
		return HELM2NotationUtils.readNotation(notation);
	}
50496
private static String changeIdForRNA(MonomerNotation monomerNotation) {
		if (monomerNotation instanceof MonomerNotationUnitRNA) {
			StringBuilder changeid = new StringBuilder();

			for (MonomerNotation not : ((MonomerNotationUnitRNA) monomerNotation).getContents()) {
				Monomer monomer = nucleotidesNaturalAnalog.get(not.getUnit().replace("[", "").replace("]", ""));
				String id = monomer.getNaturalAnalog();
				if (monomer.getMonomerType().equals(Monomer.BRANCH_MOMONER_TYPE)) {
					id = "(" + id + ")";
				}
				changeid.append(id);
			}
			return changeid.toString();
		} else {
			Monomer monomer = nucleotidesNaturalAnalog.get(monomerNotation.getUnit().replace("[", "").replace("]", ""));
			String id = monomer.getNaturalAnalog();
			if (monomer.getMonomerType().equals(Monomer.BRANCH_MOMONER_TYPE)) {
				id = "(" + id + ")";
			}
			return id;
		}
	}
116281
public Boolean validate(GraphValidator<K, VV, EV> validator) throws Exception {
		return validator.validate(this);
	}
525978
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    String valueAsString = Objects.toString(pvalue, StringUtils.EMPTY);
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (ignoreWhiteSpaces) {
      valueAsString = valueAsString.replaceAll("\\s", StringUtils.EMPTY);
    }
    if (ignoreMinus) {
      valueAsString = valueAsString.replaceAll("-", StringUtils.EMPTY);
    }
    if (ignoreSlashes) {
      valueAsString = valueAsString.replaceAll("/", StringUtils.EMPTY);
    }
    return StringUtils.length(valueAsString) == size1 || StringUtils.length(valueAsString) == size2;
  }
621141
public static boolean hasNucleotideModification(List<PolymerNotation> polymers) throws NotationException {
    for (PolymerNotation polymer : getRNAPolymers(polymers)) {
      if (RNAUtils.hasNucleotideModification(polymer)) {
        return true;
      }
    }
    return false;
  }
296183
def _is_rna(pe):
    """"""
    val = isinstance(pe, _bp('Rna')) or isinstance(pe, _bpimpl('Rna'))
    return val
1373006
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);

    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    try {
      String countryCode =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCountryCode);
      final String phoneNumber =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldPhoneNumber);
      if (StringUtils.isEmpty(phoneNumber)) {
        return true;
      }

      if (this.allowLowerCaseCountryCode) {
        countryCode = StringUtils.upperCase(countryCode);
      }
      this.phoneNumberUtil.setCountryCode(countryCode);
      final PhoneNumberData parsedNumber = this.phoneNumberUtil.parsePhoneNumber(phoneNumber);

      if (parsedNumber.isValid()) {
        if (this.allowDin5008 && (StringUtils.equals(phoneNumber,
            this.phoneNumberUtil.formatDin5008National(parsedNumber))
            || StringUtils.equals(phoneNumber,
                this.phoneNumberUtil.formatDin5008International(parsedNumber)))) {
          return true;
        }
        if (this.allowE123 && (StringUtils.equals(phoneNumber,
            this.phoneNumberUtil.formatE123National(parsedNumber))
            || StringUtils.equals(phoneNumber,
                this.phoneNumberUtil.formatE123International(parsedNumber)))) {
          return true;
        }
        if (this.allowUri
            && StringUtils.equals(phoneNumber, this.phoneNumberUtil.formatUrl(parsedNumber))) {
          return true;
        }
        if (this.allowMs
            && StringUtils.equals(phoneNumber, this.phoneNumberUtil.formatMs(parsedNumber))) {
          return true;
        }
        if (this.allowCommon && (StringUtils.equals(phoneNumber,
            this.phoneNumberUtil.formatCommonNational(parsedNumber))
            || StringUtils.equals(phoneNumber,
                this.phoneNumberUtil.formatCommonInternational(parsedNumber)))) {
          return true;
        }
      }
      this.switchContext(pcontext);
      return false;
    } catch (final Exception ignore) {
      this.switchContext(pcontext);
      return false;
    }
  }
1194560
public static boolean checkName(String nameSpec, String identifier, LombokNode<?, ?, ?> errorNode) {
		if (identifier.isEmpty()) {
			errorNode.addError(nameSpec + " cannot be the empty string.");
			return false;
		}
		
		if (!JavaIdentifiers.isValidJavaIdentifier(identifier)) {
			errorNode.addError(nameSpec + " must be a valid java identifier.");
			return false;
		}
		
		return true;
	}
1053875
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    try {
      // execute regular expression, result doesn't matter
      "x".matches(pvalue);
      return true;
    } catch (final Exception pexception) {
      // regular expression is invalid
      return false;
    }
  }
224892
protected String validateMetaLine(String metaLineStr)
    throws IOException {
        if (metaLineStr.length() > MAX_METADATA_LINE_LENGTH) {
            throw new IOException("Metadata line too long ("
                + metaLineStr.length() + ">" + MAX_METADATA_LINE_LENGTH 
                + "): " + metaLineStr);
        }
     	Matcher m = METADATA_LINE_PATTERN.matcher(metaLineStr);
        if (!m.matches()) {
            throw new IOException("Metadata line doesn't match expected" +
                " pattern: " + metaLineStr);
        }
        return metaLineStr;
    }
1237232
private boolean isValidElement() {

        boolean validElement = false;
        List elementList = new ArrayList();
        try {
            // get Elements of template stored in Property "template-elements"
            String elements = m_cmsObject.readPropertyObject(
                m_template,
                CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS,
                false).getValue();
            // template may contain more than one Element
            // Elements are separated by the delimiter ","
            if (elements != null) {
                StringTokenizer T = new StringTokenizer(elements, ",");
                while (T.hasMoreTokens()) {
                    // current element probably looks like "body*|Body" <name><mandatory>|<nicename>
                    String currentElement = T.nextToken();
                    int sepIndex = currentElement.indexOf("|");
                    if (sepIndex != -1) {
                        // current element == "body*"
                        currentElement = currentElement.substring(0, sepIndex);
                    }
                    if (currentElement.endsWith("*")) {
                        // current element == "body"
                        currentElement = currentElement.substring(0, currentElement.length() - 1);
                    }
                    elementList.add(currentElement);
                }
            }
            if (elementList.contains(m_element)) {
                validElement = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return validElement;
    }
864107
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (!StringUtils.isNumeric(valueAsString)) {
      // EAN8 must be numeric, but that's handled by digits annotation
      return true;
    }
    if (valueAsString.length() != GTIN8_LENGTH) {
      // EAN8 size is wrong, but that's handled by size annotation
      return true;
    }
    // calculate and check checksum (GTIN8/EAN8)
    return CHECK_GTIN8.isValid(valueAsString);
  }
428425
public void validate(Document doc) {
    	try {
    		doValidate(doc);
    	}
        catch (Exception e) {
            throw new PluginException("Error validating document: " + e, e);
        }
    }
354714
private boolean parseLine() {
    cureid = null;
    curpoly = null;
    curlbl = null;
    polys.clear();
    coords.clear();
    labels.clear();

    Matcher m = COORD.matcher(reader.getBuffer());
    for(/* initialized by nextLineExceptComments */; tokenizer.valid(); tokenizer.advance()) {
      m.region(tokenizer.getStart(), tokenizer.getEnd());
      if(m.find()) {
        try {
          double c1 = ParseUtil.parseDouble(m.group(1));
          double c2 = ParseUtil.parseDouble(m.group(2));
          if(m.group(3) != null) {
            double c3 = ParseUtil.parseDouble(m.group(3));
            coords.add(new double[] { c1, c2, c3 });
          }
          else {
            coords.add(new double[] { c1, c2 });
          }
          continue;
        }
        catch(NumberFormatException e) {
          LOG.warning("Looked like a coordinate pair but didn't parse: " + tokenizer.getSubstring());
        }
      }
      // Match polygon separator:
      // FIXME: Avoid unnecessary subSequence call.
      final int len = tokenizer.getEnd() - tokenizer.getStart();
      if(POLYGON_SEPARATOR.length() == len && //
          reader.getBuffer().subSequence(tokenizer.getStart(), tokenizer.getEnd()).equals(POLYGON_SEPARATOR)) {
        if(!coords.isEmpty()) {
          polys.add(new Polygon(new ArrayList<>(coords)));
        }
        continue;
      }
      String cur = tokenizer.getSubstring();
      // First label will become the External ID
      if(cureid == null) {
        cureid = new ExternalID(cur);
      }
      else {
        labels.add(cur);
      }
    }
    // Complete polygon
    if(!coords.isEmpty()) {
      polys.add(new Polygon(coords));
    }
    curpoly = new PolygonsObject(polys);
    curlbl = (haslabels || !labels.isEmpty()) ? LabelList.make(labels) : null;
    return true;
  }
754605
public final static void addPolymerNotation(int position, PolymerNotation polymer, HELM2Notation helm2notation) {
		helm2notation.getListOfPolymers().add(position, polymer);
	}