@Override public PathExpressionOutput<ReturnType> sequencingFrom( final String fromPathExpression ) { CheckArg.isNotEmpty(fromPathExpression, "fromPathExpression"); return new PathExpressionOutput<ReturnType>() { @Override public SequencerDefinition<ReturnType> andOutputtingTo( String into ) { CheckArg.isNotEmpty(into, "into"); return sequencingFrom(PathExpression.compile(fromPathExpression + " => " + into)); } }; } }
/** * @param resourceName the resource name associated with the permission (cannot be <code>null</code> or empty) */ public Permission( final String resourceName ) { CheckArg.isNotEmpty(resourceName, "resourceName"); this.resourceName = resourceName; }
/** * @param value the value being checked to see if it is a reference (cannot be <code>null</code> or empty) * @return <code>true</code> if value is a reference */ public boolean isReference( final String value ) { CheckArg.isNotEmpty(value, "value"); return (value.startsWith(CoreLexicon.ModelId.MM_HREF_PREFIX)); }
public SelectorName( String name ) { CheckArg.isNotEmpty(name, "name"); this.name = name; this.expandedForm = name.startsWith("{"); }
/** * Create a location defined by multiple identification properties. This method does not check whether the identification * properties are duplicated. * * @param idProperties the identification properties * @return a new <code>Location</code> with no path and the given identification properties. * @throws IllegalArgumentException if <code>idProperties</code> is null or empty */ public static Location create( List<Property> idProperties ) { CheckArg.isNotEmpty(idProperties, "idProperties"); return new LocationWithProperties(idProperties); }
@Override public IndexDefinitionTemplate setWorkspaces( String... workspaceNames ) { CheckArg.isNotEmpty(workspaceNames, "workspaceNames"); this.workspaceRule = RepositoryIndexDefinition.workspaceMatchRule(workspaceNames); return this; }
/** * Make sure the column on the named table has extra columns that can be used without validation error. * * @param tableName the name of the table * @return this builder, for convenience in method chaining; never null * @throws IllegalArgumentException if the table name is null or empty, or the table does not exist */ public Builder markExtraColumns( String tableName ) { CheckArg.isNotEmpty(tableName, "tableName"); tablesOrViewsWithExtraColumns.add(new SelectorName(tableName)); return this; }
/** * Make sure the column on the named table has extra columns that can be used without validation error. * * @param tableName the name of the table * @return this builder, for convenience in method chaining; never null * @throws IllegalArgumentException if the table name is null or empty, or the table does not exist */ public Builder markExtraColumns( String tableName ) { CheckArg.isNotEmpty(tableName, "tableName"); tablesOrViewsWithExtraColumns.add(new SelectorName(tableName)); return this; }
public void addIrregular( String singular, String plural ) { CheckArg.isNotEmpty(singular, "singular rule"); CheckArg.isNotEmpty(plural, "plural rule"); String singularRemainder = singular.length() > 1 ? singular.substring(1) : ""; String pluralRemainder = plural.length() > 1 ? plural.substring(1) : ""; addPluralize("(" + singular.charAt(0) + ")" + singularRemainder + "$", "$1" + pluralRemainder); addSingularize("(" + plural.charAt(0) + ")" + pluralRemainder + "$", "$1" + singularRemainder); }
public SetCriteria( DynamicOperand left, StaticOperand... setOperands ) { CheckArg.isNotNull(left, "left"); CheckArg.isNotNull(setOperands, "setOperands"); CheckArg.isNotEmpty(setOperands, "setOperands"); this.left = left; this.setOperands = Collections.unmodifiableList(Arrays.asList(setOperands)); }
public SetCriteria( DynamicOperand left, StaticOperand... setOperands ) { CheckArg.isNotNull(left, "left"); CheckArg.isNotNull(setOperands, "setOperands"); CheckArg.isNotEmpty(setOperands, "setOperands"); this.left = left; this.setOperands = Collections.unmodifiableList(Arrays.asList(setOperands)); }
/** * Creates a new anonymous provider. * * @param anonymousUsername the anonymous user name * @param userRoles the set of roles for the anonymous user */ public AnonymousProvider( final String anonymousUsername, final Set<String> userRoles ) { CheckArg.isNotEmpty(anonymousUsername, "anonymousUsername"); CheckArg.isNotNull(userRoles, "userRoles"); this.anonymousContext = new AnonymousSecurityContext(userRoles, anonymousUsername); }
/** * {@inheritDoc} */ public Name create( String namespaceUri, String localName, TextDecoder decoder ) { CheckArg.isNotEmpty(localName, "localName"); if (decoder == null) decoder = getDecoder(); namespaceUri = namespaceUri != null ? decoder.decode(namespaceUri.trim()) : null; localName = decoder.decode(localName.trim()); return new BasicName(namespaceUri, localName); }
@Override public Name create( String namespaceUri, String localName, TextDecoder decoder ) { CheckArg.isNotEmpty(localName, "localName"); if (decoder == null) decoder = getDecoder(); namespaceUri = namespaceUri != null ? decoder.decode(namespaceUri.trim()) : null; localName = decoder.decode(localName.trim()); return new BasicName(namespaceUri, localName); }
/** * @param node the node whose multi-valued property a value is being added to (cannot be <code>null</code>) * @param propertyName the multi-valued property name (cannot be <code>null</code> or empty) * @param newValue the value being added (cannot be <code>null</code> or empty) * @throws Exception if there is a problem adding the property value */ protected void addPropertyValue( final Node node, final String propertyName, final String newValue ) throws Exception { CheckArg.isNotEmpty(newValue, "newValue"); addPropertyValue(node, propertyName, this.context.valueFactory().createValue(newValue)); }
/** * @param node the node whose multi-valued property a value is being added to (cannot be <code>null</code>) * @param propertyName the multi-valued property name (cannot be <code>null</code> or empty) * @param newValue the value being added (cannot be <code>null</code> or empty) * @throws Exception if there is a problem adding the property value */ protected void addPropertyValue( final Node node, final String propertyName, final String newValue ) throws Exception { CheckArg.isNotEmpty(newValue, "newValue"); addPropertyValue(node, propertyName, this.context.valueFactory().createValue(newValue)); }
protected AbstractValueComparatorsTest( Comparator<T> comparator, T... validNonNullValues ) { CheckArg.isNotNull(comparator, "comparator"); CheckArg.isNotEmpty(validNonNullValues, "validNonNullValues"); this.comparator = comparator; this.validNonNullValues = validNonNullValues; }
@Override public AbstractJcrItem getItem( String absPath ) throws PathNotFoundException, RepositoryException { checkLive(); CheckArg.isNotEmpty(absPath, "absPath"); Path path = absolutePathFor(absPath); return getItem(path); }
@Override public void setName( String name ) throws ConstraintViolationException { CheckArg.isNotEmpty(name, "name"); try { this.name = context.getValueFactories().getNameFactory().create(name); } catch (ValueFormatException vfe) { throw new ConstraintViolationException(vfe); } }
protected void validateCrossWorkspaceAction( String srcWorkspace ) throws RepositoryException { CheckArg.isNotEmpty(srcWorkspace, "srcWorkspace"); session.checkLive(); session.checkWorkspacePermission(srcWorkspace, ModeShapePermissions.READ); session.checkWorkspacePermission(getName(), ModeShapePermissions.READ); JcrRepository repository = repository(); if (!repository.hasWorkspace(srcWorkspace)) { throw new NoSuchWorkspaceException(JcrI18n.workspaceNameIsInvalid.text(repository.getName(), srcWorkspace)); } }