/** * @see javax.jcr.Value#getType() */ @Override public int getType() { return type.tag(); }
@NotNull @Override public Integer perform() throws RepositoryException { return property.getPropertyState().getType().tag(); } });
@Nonnull @Override public Integer perform() throws RepositoryException { return property.getPropertyState().getType().tag(); } });
@Override int getPropertyType() { PropertyValue v = currentValue(); return v.getType().tag(); }
@Override int getPropertyType() { PropertyValue v = currentValue(); return v.getType().tag(); }
@Override int getPropertyType() { PropertyValue v = currentValue(); return v == null ? PropertyType.UNDEFINED : v.getType().tag(); }
private void checkRequiredType(PropertyState property, int requiredType) throws CommitFailedException { if (requiredType != property.getType().tag()) { constraintViolation(55, "Required property type violation in " + property); } }
@Nonnull @Override public PropertyDefinition getDefinition( Tree parent, PropertyState property, boolean exactTypeMatch) throws RepositoryException { Type<?> type = property.getType(); EffectiveNodeType effective = getEffectiveNodeType(parent); return effective.getPropertyDefinition( property.getName(), type.isArray(), type.tag(), exactTypeMatch); }
@NotNull @Override public PropertyDefinition getDefinition( Tree parent, PropertyState property, boolean exactTypeMatch) throws RepositoryException { Type<?> type = property.getType(); EffectiveNodeType effective = getEffectiveNodeType(parent); return effective.getPropertyDefinition( property.getName(), type.isArray(), type.tag(), exactTypeMatch); }
@Override public String toString() { if (value.getType() == Type.STRING) { return escape(); } else if (value.getType() == Type.LONG) { return Long.toString(value.getValue(Type.LONG)); } else { String type = PropertyType.nameFromValue(value.getType().tag()); return "cast(" + escape() + " as " + type.toLowerCase(Locale.ENGLISH) + ')'; } }
protected boolean includePropertyValue(PropertyState property, int i, PropertyDefinition pd) { if (property.getType().tag() == PropertyType.BINARY){ return true; } if (pd.valuePattern.matchesAll()) { return true; } return includePropertyValue(property.getValue(Type.STRING, i), pd); }
private PropertyDefinition getDefinition(PropertyState property) throws RepositoryException { String propertyName = property.getName(); int propertyType = property.getType().tag(); boolean isMultiple = property.isArray(); return getPropertyDefinition(propertyName, isMultiple, propertyType, true); }
private PropertyDefinition getDefinition(PropertyState property) throws RepositoryException { String propertyName = property.getName(); int propertyType = property.getType().tag(); boolean isMultiple = property.isArray(); return getPropertyDefinition(propertyName, isMultiple, propertyType, true); }
private PropertyDefinition getDefinition(PropertyState property) throws RepositoryException { String propertyName = property.getName(); int propertyType = property.getType().tag(); boolean isMultiple = property.isArray(); return getPropertyDefinition(propertyName, isMultiple, propertyType, true); }
@Override public int getRestrictionType(String restrictionName) { for (RestrictionDefinition definition : getRestrictionProvider().getSupportedRestrictions(getOakPath())) { String jcrName = namePathMapper.getJcrName(definition.getName()); if (jcrName.equals(restrictionName)) { return definition.getRequiredType().tag(); } } // for backwards compatibility with JR2 return undefined type for an // unknown restriction name. return PropertyType.UNDEFINED; }
private void assertTypeLessThan(Type<?> a, Type<?> b) { assertTrue(a.compareTo(b) < 0); assertTrue(b.compareTo(a) > 0); if (a.tag() > b.tag()) { fail("Types should be ordered by increasing tag value"); } if (b.tag() == a.tag() && a.isArray() && !b.isArray()) { fail("If their tag is the same, types should be ordered by multiplicity"); } }
@Override public void performVoid() throws RepositoryException { Type<?> type = dlg.getPropertyState().getType(); if (type.isArray()) { throw new ValueFormatException( "This is a multi-valued property"); } Value converted = ValueHelper.convert( value, type.tag(), getValueFactory()); dlg.setState(createSingleState(dlg.getName(), converted, type)); }
@Test public void testGetRestrictionType() { AbstractAccessControlList acl = createEmptyACL(); for (RestrictionDefinition def : getRestrictionProvider().getSupportedRestrictions(getTestPath())) { int reqType = acl.getRestrictionType(getNamePathMapper().getJcrName(def.getName())); assertTrue(reqType > PropertyType.UNDEFINED); assertEquals(def.getRequiredType().tag(), reqType); } }