Package javax.jcr

Examples of javax.jcr.ValueFormatException


               }
               else
               {
                  if ((defs.getDefinition(true) == null) && (defs.getDefinition(false) != null))
                  {
                     throw new ValueFormatException("Can not assign multiple-values Value"
                        + " to a single-valued property " + propName.getAsString() + " node " + jcrName.getName());
                  }
               }

               newProperty =
View Full Code Here


         {
            validateValueDefaults(pdef.getRequiredType(), pdef.getDefaultValues());
         }
         catch (ValueFormatException e)
         {
            throw new ValueFormatException("Default value is incompatible with Property type "
               + PropertyType.nameFromValue(pdef.getRequiredType()) + " of " + pdef.getName().getAsString()
               + " in nodetype " + nodeType.getName().getAsString(), e);
         }
        
         try
         {
            validateValueConstraints(pdef.getRequiredType(), pdef.getValueConstraints());
         }
         catch (ValueFormatException e)
         {
            throw new ValueFormatException("Constraints is incompatible with Property type "
               + PropertyType.nameFromValue(pdef.getRequiredType()) + " of " + pdef.getName().getAsString()
               + " in nodetype " + nodeType.getName().getAsString(), e);
         }
      }
View Full Code Here

            + nodeData().getQPath().getAsString());
      }

      if (!existed.isMultiValued())
      {
         throw new ValueFormatException("An existed property is single-valued " + name.getAsString());
      }

      TransientPropertyData tdata =
         new TransientPropertyData(QPath.makeChildPath(getInternalPath(), name), existed.getIdentifier(), existed
            .getPersistedVersion(), existed.getType(), existed.getParentIdentifier(), existed.isMultiValued(), values);
View Full Code Here

      {
         return ISO8601.parseEx(dateString);
      }
      catch (ParseException e)
      {
         throw new ValueFormatException("Can not parse date from [" + dateString + "]", e);
      }
      catch (NumberFormatException e)
      {
         throw new ValueFormatException("Can not parse date from [" + dateString + "]", e);
      }
   }
View Full Code Here

                  + isoCalendar.getTime() + "]");
            }
         }
         catch (ParseException e)
         {
            throw new ValueFormatException(e);
         }

         return isoCalendar;
      }
      throw new ValueFormatException("Can't deserialize calendar string [" + serString + "]");
   }
View Full Code Here

            + locationFactory.createJCRPath(qpath).getAsString(false));
      }

      if (multiValue && (def == null || (prevProp != null && !prevProp.isMultiValued())))
      {
         throw new ValueFormatException("Can not assign multiple-values Value to a single-valued property "
            + locationFactory.createJCRPath(qpath).getAsString(false));
      }

      if (!multiValue && (def == null || (prevProp != null && prevProp.isMultiValued())))
      {
         throw new ValueFormatException("Can not assign single-value Value to a multiple-valued property "
            + locationFactory.createJCRPath(qpath).getAsString(false));
      }

      List<ValueData> valueDataList = new ArrayList<ValueData>();

      // cast to required type if neccessary
      int requiredType = def.getRequiredType();

      int propType = requiredType;
      // if list of values not null
      if (propertyValues != null)
      {
         // All Value objects in the array must be of the same type, otherwise a
         // ValueFormatException is thrown.
         if (propertyValues.length > 1)
         {
            if (propertyValues[0] != null)
            {
               int vType = propertyValues[0].getType();
               for (Value val : propertyValues)
               {
                  if (val != null && vType != val.getType())
                  {
                     throw new ValueFormatException("All Value objects in the array must be of the same type");
                  }
               }
            }
         }
View Full Code Here

         case ExtendedPropertyType.PERMISSION :
            PermissionValue permValue = (PermissionValue)value;
            AccessControlEntry ace = new AccessControlEntry(permValue.getIdentity(), permValue.getPermission());
            return new TransientValueData(ace);
         default :
            throw new ValueFormatException("ValueFactory.convert() unknown or unconvertable type " + type);
      }
   }
View Full Code Here

      checkValid();

      if (isMultiValued())
      {
         throw new ValueFormatException("The property " + getPath() + " is multi-valued (6.2.4)");
      }

      if (propertyData.getValues() != null && propertyData.getValues().size() == 0)
      {
         throw new ValueFormatException("The single valued property " + getPath() + " is empty");
      }

      return valueFactory.loadValue(propertyData.getValues().get(0), propertyData.getType());

   }
View Full Code Here

      checkValid();

      // Check property definition and life-state flag both
      if (!isMultiValued())
      {
         throw new ValueFormatException("The property " + getPath() + " is single-valued (6.2.4)");
      }

      // The array returned is a copy of the stored values
      return getValueArray();
   }
View Full Code Here

      {
         return getValue().getString();
      }
      catch (ValueFormatException e)
      {
         throw new ValueFormatException("PropertyImpl.getString() for " + getPath() + " failed: " + e);
      }
      catch (IllegalStateException e)
      {
         throw new ValueFormatException("PropertyImpl.getString() for " + getPath() + " failed: " + e);
      }
   }
View Full Code Here

TOP

Related Classes of javax.jcr.ValueFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.