Codota Logo
ValueConstraint
Code IndexAdd Codota to your IDE (free)

How to use
ValueConstraint
in
eu.europa.esig.jaxb.policy

Best Java code snippets using eu.europa.esig.jaxb.policy.ValueConstraint (Showing top 11 results out of 315)

origin: esig/dss

/**
 * Create an instance of {@link ValueConstraint }
 * 
 */
public ValueConstraint createValueConstraint() {
  return new ValueConstraint();
}
origin: esig/dss

@Override
protected boolean process() {
  if (!EIDASUtils.isPostGracePeriod(currentTime)) {
    return true;
  }
  String expectedVersionString = constraint.getValue();
  int version = 5; // default eIDAS
  try {
    version = Integer.parseInt(expectedVersionString);
  } catch (NumberFormatException e) {
    LOG.warn("Unable to parse TLVersion constraint : '{}'", expectedVersionString);
  }
  Integer tlVersion = currentTL.getVersion();
  return (tlVersion != null) && (tlVersion.intValue() == version);
}
origin: esig/dss

@Test
public void contentTypeCheck() throws Exception {
  XmlSignature sig = new XmlSignature();
  sig.setContentType("Valid_Value");
  ValueConstraint constraint = new ValueConstraint();
  constraint.setLevel(Level.FAIL);
  constraint.setValue("Valid_Value");
  XmlSAV result = new XmlSAV();
  ContentTypeCheck ctc = new ContentTypeCheck(result, new SignatureWrapper(sig), constraint);
  ctc.execute();
  List<XmlConstraint> constraints = result.getConstraint();
  assertEquals(1, constraints.size());
  assertEquals(XmlStatus.OK, constraints.get(0).getStatus());
}
origin: esig/dss

  @Test
  public void failedContentTypeCheck() throws Exception {
    XmlSignature sig = new XmlSignature();
    sig.setContentType("Invalid_Value");

    ValueConstraint constraint = new ValueConstraint();
    constraint.setLevel(Level.FAIL);
    constraint.setValue("Valid_Value");

    XmlSAV result = new XmlSAV();
    ContentTypeCheck ctc = new ContentTypeCheck(result, new SignatureWrapper(sig), constraint);
    ctc.execute();

    List<XmlConstraint> constraints = result.getConstraint();
    assertEquals(1, constraints.size());
    assertEquals(XmlStatus.NOT_OK, constraints.get(0).getStatus());
  }
}
origin: esig/dss

@Test
public void contentIdentifierCheck() throws Exception {
  XmlSignature sig = new XmlSignature();
  sig.setContentIdentifier("Valid_Value");
  ValueConstraint constraint = new ValueConstraint();
  constraint.setLevel(Level.FAIL);
  constraint.setValue("Valid_Value");
  XmlSAV result = new XmlSAV();
  ContentIdentifierCheck cic = new ContentIdentifierCheck(result, new SignatureWrapper(sig), constraint);
  cic.execute();
  List<XmlConstraint> constraints = result.getConstraint();
  assertEquals(1, constraints.size());
  assertEquals(XmlStatus.OK, constraints.get(0).getStatus());
}
origin: esig/dss

@Override
protected boolean process() {
  String contentType = signature.getContentType();
  String expectedValue = constraint.getValue();
  return processValueCheck(contentType, expectedValue);
}
origin: esig/dss

@Test
public void failedContentHintsCheck() throws Exception {
  XmlSignature sig = new XmlSignature();
  sig.setContentHints("Invalid_Value");
  ValueConstraint constraint = new ValueConstraint();
  constraint.setLevel(Level.FAIL);
  constraint.setValue("Valid_Value");
  XmlSAV result = new XmlSAV();
  ContentHintsCheck chc = new ContentHintsCheck(result, new SignatureWrapper(sig), constraint);
  chc.execute();
  List<XmlConstraint> constraints = result.getConstraint();
  assertEquals(1, constraints.size());
  assertEquals(XmlStatus.NOT_OK, constraints.get(0).getStatus());
}
origin: esig/dss

@Override
protected boolean process() {
  String contentIdentifier = signature.getContentIdentifier();
  String expected = constraint.getValue();
  return processValueCheck(contentIdentifier, expected);
}
origin: esig/dss

@Test
public void contentHintsCheck() throws Exception {
  XmlSignature sig = new XmlSignature();
  sig.setContentHints("Valid_Value");
  ValueConstraint constraint = new ValueConstraint();
  constraint.setLevel(Level.FAIL);
  constraint.setValue("Valid_Value");
  XmlSAV result = new XmlSAV();
  ContentHintsCheck chc = new ContentHintsCheck(result, new SignatureWrapper(sig), constraint);
  chc.execute();
  List<XmlConstraint> constraints = result.getConstraint();
  assertEquals(1, constraints.size());
  assertEquals(XmlStatus.OK, constraints.get(0).getStatus());
}
origin: esig/dss

@Override
protected boolean process() {
  String contentType = signature.getContentHints();
  String expectedValue = constraint.getValue();
  return processValueCheck(contentType, expectedValue);
}
origin: esig/dss

  @Test
  public void failedContentIdentifierCheck() throws Exception {
    XmlSignature sig = new XmlSignature();
    sig.setContentIdentifier("Invalid_Value");

    ValueConstraint constraint = new ValueConstraint();
    constraint.setLevel(Level.FAIL);
    constraint.setValue("Valid_Value");

    XmlSAV result = new XmlSAV();
    ContentIdentifierCheck cic = new ContentIdentifierCheck(result, new SignatureWrapper(sig), constraint);
    cic.execute();

    List<XmlConstraint> constraints = result.getConstraint();
    assertEquals(1, constraints.size());
    assertEquals(XmlStatus.NOT_OK, constraints.get(0).getStatus());
  }
}
eu.europa.esig.jaxb.policyValueConstraint

Javadoc

Value check : follows the specified level behavior if the checked element is not equals to the specified value

Java class for ValueConstraint complex type.

The following schema fragment specifies the expected content contained within this class.

 
<complexType name="ValueConstraint"> 
<complexContent> 
<extension base="{http://dss.esig.europa.eu/validation/policy}LevelConstraint"> 
<attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" /> 
</extension> 
</complexContent> 
</complexType> 

Most used methods

  • <init>
  • getValue
    Gets the value of the value property.
  • setLevel
  • setValue
    Sets the value of the value property.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now