Package org.apache.slide.projector.i18n

Examples of org.apache.slide.projector.i18n.ErrorMessage


      } else if ( node instanceof CDATA ) {
        return new StringValue(((CDATA)node).toString());
      } else if ( node instanceof ProcessingInstruction ) {
        return new StringValue(((ProcessingInstruction)node).getData());
        }
        throw new ProcessException(new ErrorMessage("unconvertableJDomNode"));
    }
View Full Code Here


    public void configure(StreamableValue config) throws ConfigurationException {
        try {
            transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(config.getInputStream()));
        } catch (TransformerConfigurationException e) {
            throw new ConfigurationException(new ErrorMessage("xslTransformer/creationgFailed"), e);
        } catch (IOException e) {
            throw new ConfigurationException(new ErrorMessage("xslTransformer/ioException"), e);
        }
    }
View Full Code Here

      return entryDescriptors;
    }
   
    public Value valueOf(Object value, Context context) throws ValueCastException {
        if ( entryDescriptors.isEmpty() ) {
          throw new ValueCastException(new ErrorMessage("noMapEntryDescriptorsFound"));
        }
        if ( value instanceof MapValue ) {
            return castedMap(((MapValue)value).getMap(), context);
        } else if ( value instanceof Map ) {
            return castedMap((Map)value, context);
        } else {
            throw new ValueCastException(new ErrorMessage("uncastableMapValue", new Object[] { value }));
        }
    }
View Full Code Here

                Object value = entry.getValue();
              if ( value instanceof AnyValue ) {
                try {
                          castedMap.put(entry.getKey(), entryDescriptor.valueOf(((AnyValue)value).load(context), context));
              } catch (Exception e) {
                  throw new ValueCastException(new ErrorMessage("uncastableArrayValue", new Object[] { value }));
              }
              } else {
                      castedMap.put(entry.getKey(), entryDescriptor.valueOf(value, context));
              }
              }
            } else {
              if ( !castedMap.containsKey(key) ) {
                if ( !parameterDescriptor.isRequired() ) {
                  castedMap.put(key, parameterDescriptor.getDefaultValue());
                }
              } else {
                Object object = castedMap.get(key);
              if ( object instanceof AnyValue ) {
                        try {
              object = ((AnyValue)object).load(context);
            } catch (Exception e) {
                  throw new ValueCastException(new ErrorMessage("uncastableArrayValue", new Object[] { object }), e);
            }
              }
                if ( object.equals(parameterDescriptor.getDefaultValue())) {
                  castedMap.put(key, object);
                } else {
View Full Code Here

                }
              }
            } else {
              if ( !map.containsKey(key) ) {
                if ( parameterDescriptor.isRequired() ) {
                  throw new ValidationException(new ErrorMessage("mapEntryMissing", new String[] { key }));
                }
              } else {
                Value entryValue = (Value)map.get(key);
                if ( !(entryValue instanceof NullValue) ) {
                  entryDescriptor.validate(entryValue, context);
View Full Code Here

        } else if (value instanceof String[]) {
            return new StringValue(((String [])value)[0]);
        } else if (value instanceof PrintableValue) {
            return new StringValue(((PrintableValue)value).print(new StringBuffer(256)).toString());
        }
        throw new ValueCastException(new ErrorMessage("uncastableStringValue", new Object[] { value }));
    }
View Full Code Here

          for ( Iterator i = allowedValues.iterator(); i.hasNext(); ) {
            if (valueAsString.equals((String)i.next())) {
              return;
            }
          }
          throw new ValidationException(new ErrorMessage("invalidStringValue", new String[] { valueAsString }));
        } else {
          if ( minimumLength != -1 && valueAsString.length() < minimumLength ) throw new ValidationException(new ErrorMessage("stringTooShort", new Object[] { new Integer(minimumLength) }));
          if ( maximumLength != -1 && valueAsString.length() > maximumLength ) throw new ValidationException(new ErrorMessage("stringTooLong", new Object[] { new Integer(maximumLength) }));
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.projector.i18n.ErrorMessage

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.