private HashSet<String> getValidCharacters(CharacterClassType characterClassType, ValuePolicyType passwordPolicy) { if (null != characterClassType.getValue()) { return new HashSet<>(StringPolicyUtils.stringTokenizer(characterClassType.getValue())); } else { return new HashSet<>(StringPolicyUtils.stringTokenizer(StringPolicyUtils .collectCharacterClass(passwordPolicy.getStringPolicy().getCharacterClass(), characterClassType.getRef()))); } }
clone.value = ((this.value == null)?null:this.getValue());
/** * Creates a new {@code CharacterClassType} instance by deeply copying a given {@code CharacterClassType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public CharacterClassType(final CharacterClassType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'CharacterClassType' from 'null'."); } // 'CharacterClass' collection. if (o.characterClass!= null) { copyCharacterClass(o.getCharacterClass(), this.getCharacterClass()); } // CBuiltinLeafInfo: java.lang.String this.value = ((o.value == null)?null:o.getValue()); // CBuiltinLeafInfo: javax.xml.namespace.QName this.ref = ((o.ref == null)?null:o.getRef()); // CBuiltinLeafInfo: javax.xml.namespace.QName this.name = ((o.name == null)?null:o.getName()); }
if (stringPolicy != null) { for (StringLimitType l : stringPolicy.getLimitations().getLimit()) { if (null != l.getCharacterClass().getValue()) { lims.put(l, StringPolicyUtils.stringTokenizer(l.getCharacterClass().getValue())); } else { lims.put(l, StringPolicyUtils.stringTokenizer(StringPolicyUtils.collectCharacterClass(
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<CharacterClassType> theCharacterClass; theCharacterClass = (((this.characterClass!= null)&&(!this.characterClass.isEmpty()))?this.getCharacterClass():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "characterClass", theCharacterClass), currentHashCode, theCharacterClass); } { String theValue; theValue = this.getValue(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); } { QName theRef; theRef = this.getRef(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ref", theRef), currentHashCode, theRef); } { QName theName; theName = this.getName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); } return currentHashCode; }
@Test public void stringPolicyUtilsMinimalTest() throws JAXBException, SchemaException, IOException { File file = new File(TEST_DIR, "password-policy-minimal.xml"); ValuePolicyType pp = (ValuePolicyType) PrismTestUtil.parseObject(file).asObjectable(); StringPolicyType sp = pp.getStringPolicy(); StringPolicyUtils.normalize(sp); AssertJUnit.assertNotNull(sp.getCharacterClass()); AssertJUnit.assertNotNull(sp.getLimitations().getLimit()); AssertJUnit.assertTrue(Integer.MAX_VALUE == sp.getLimitations().getMaxLength()); AssertJUnit.assertTrue(0 == sp.getLimitations().getMinLength()); AssertJUnit.assertTrue(0 == " !\"#$%&'()*+,-.01234567890:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .compareTo(sp.getCharacterClass().getValue())); }