/** * Create an instance of {@link CharacterClassType } * */ public CharacterClassType createCharacterClassType() { return new CharacterClassType(); }
/** * 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()); }
public CharacterClassType value(String value) { setValue(value); return this; }
public CharacterClassType beginCharacterClass() { CharacterClassType value = new CharacterClassType(); characterClass(value); return value; }
if (null != cc.getValue() && (null == ref || ref.equals(cc.getName()))) { l.append(cc.getValue()); } else if (null != cc.getCharacterClass() && !cc.getCharacterClass().isEmpty()) { for (CharacterClassType subClass : cc.getCharacterClass()) { if (null == ref || ref.equals(cc.getName())) { l.append(collectCharacterClass(subClass, null)); } else {
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()))); } }
public static StringPolicyType normalize(StringPolicyType sp) { if (null == sp) { throw new IllegalArgumentException("Providide string policy cannot be null"); } if (null == sp.getLimitations()) { LimitationsType sl = new LimitationsType(); sl.setCheckAgainstDictionary(false); sl.setCheckPattern(""); sl.setMaxLength(Integer.MAX_VALUE); sl.setMinLength(0); sl.setMinUniqueChars(0); sp.setLimitations(sl); } // Add default char class if (null == sp.getCharacterClass()) { CharacterClassType cct = new CharacterClassType(); cct.setValue(ASCII7_CHARS); sp.setCharacterClass(cct); } return sp; }
@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())); }
public CharacterClassType characterClass(CharacterClassType value) { getCharacterClass().add(value); return this; }
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( stringPolicy.getCharacterClass(), l.getCharacterClass().getRef())));
copyCharacterClass(this.getCharacterClass(), clone.getCharacterClass()); clone.value = ((this.value == null)?null:this.getValue()); clone.ref = ((this.ref == null)?null:this.getRef()); clone.name = ((this.name == null)?null:this.getName()); return clone;
/** * Create an instance of {@link CharacterClassType } * */ public CharacterClassType createCharacterClassType() { return new CharacterClassType(); }
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; }
/** * Create an instance of {@link CharacterClassType } * */ public CharacterClassType createCharacterClassType() { return new CharacterClassType(); }
lhsCharacterClass = (((this.characterClass!= null)&&(!this.characterClass.isEmpty()))?this.getCharacterClass():null); List<CharacterClassType> rhsCharacterClass; rhsCharacterClass = (((that.characterClass!= null)&&(!that.characterClass.isEmpty()))?that.getCharacterClass():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "characterClass", lhsCharacterClass), LocatorUtils.property(thatLocator, "characterClass", rhsCharacterClass), lhsCharacterClass, rhsCharacterClass)) { return false; lhsValue = this.getValue(); String rhsValue; rhsValue = that.getValue(); if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { return false; lhsRef = this.getRef(); QName rhsRef; rhsRef = that.getRef(); if (!strategy.equals(LocatorUtils.property(thisLocator, "ref", lhsRef), LocatorUtils.property(thatLocator, "ref", rhsRef), lhsRef, rhsRef)) { return false; lhsName = this.getName(); QName rhsName; rhsName = that.getName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { return false;
public CharacterClassType beginCharacterClass() { CharacterClassType value = new CharacterClassType(); characterClass(value); return value; }
public CharacterClassType beginCharacterClass() { CharacterClassType value = new CharacterClassType(); characterClass(value); return value; }