Package javax.xml.bind

Examples of javax.xml.bind.PropertyException


    */
   public void setProperty(String pName, Object pValue) throws PropertyException {
     if (pName == null) {
       throw new IllegalArgumentException("The property name must not be null.");
     } else {
       throw new PropertyException("Unsupported property name: " + pName);
     }
   }
View Full Code Here


    */
   public Object getProperty(String pName) throws PropertyException {
     if (pName == null) {
       throw new IllegalArgumentException("The property name must not be null.");
     } else {
       throw new PropertyException("Unsupported property name: " + pName);
     }
   }
View Full Code Here

    }
    else if (_properties.containsKey(name)) {
      return _properties.get(name);
    }
   
    throw new PropertyException(name);
  }
View Full Code Here

                        copy = new HashMap<String,String>(4);
                        for (final String key : SCHEMA_KEYS) {
                            final Object schema = map.get(key);
                            if (schema != null) {
                                if (!(schema instanceof String)) {
                                    throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
                                            name + "[\"" + key + "\"]", value.getClass()));
                                }
                                copy.put(key, (String) schema);
                            }
                        }
                        copy = CollectionsExt.unmodifiableOrCopy(copy);
                    }
                    schemas = copy;
                    return;
                }
                else if (name.equals(XML.GML_VERSION)) {
                    gmlVersion = (value instanceof CharSequence) ? new Version(value.toString()) : (Version) value;
                    return;
                }
                else if (name.equals(XML.RESOLVER)) {
                    resolver = (ReferenceResolver) value;
                    return;
                }
                else if (name.equals(XML.CONVERTER)) {
                    converter = (ValueConverter) value;
                    return;
                }
                else if (name.equals(XML.STRING_SUBSTITUTES)) {
                    int mask = initialBitMasks();
                    if (value != null) {
                        for (final CharSequence substitute : (CharSequence[]) value) {
                            if (CharSequences.equalsIgnoreCase(substitute, "language")) {
                                mask |= Context.SUBSTITUTE_LANGUAGE;
                            } else if (CharSequences.equalsIgnoreCase(substitute, "country")) {
                                mask |= Context.SUBSTITUTE_COUNTRY;
                            }
                        }
                    }
                    bitMasks = mask;
                    return;
                }
                else if (name.equals(XML.WARNING_LISTENER)) {
                    warningListener = (WarningListener<?>) value;
                    return;
                }
            }
        } catch (RuntimeException e) { // (ClassCastException | IllegalArgumentException) on the JDK7 branch.
            throw new PropertyException(Errors.format(
                    Errors.Keys.IllegalPropertyClass_2, name, value.getClass()), e);
        }
        /*
         * If we reach this point, the given name is not a SIS property. Try to handle
         * it as a (un)marshaller-specific property, after saving the previous value.
View Full Code Here

        if( name == null ) {
            throw new IllegalArgumentException(
                Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
        }

        throw new PropertyException(name, value);
    }
View Full Code Here

        if( name == null ) {
            throw new IllegalArgumentException(
                Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
        }

        throw new PropertyException(name);
    }
View Full Code Here

        if( JAXB_SCHEMA_LOCATION.equals(name) )
            return getSchemaLocation();
        if( JAXB_FRAGMENT.equals(name) )
            return isFragment()?Boolean.TRUE:Boolean.FALSE;

        throw new PropertyException(name);
    }
View Full Code Here

    /*
     * assert that the given object is a Boolean
     */
    private void checkBoolean( String name, Object value ) throws PropertyException {
        if(!(value instanceof Boolean))
            throw new PropertyException(
                Messages.format( Messages.MUST_BE_BOOLEAN, name ) );
    }
View Full Code Here

    /*
     * assert that the given object is a String
     */
    private void checkString( String name, Object value ) throws PropertyException {
        if(!(value instanceof String))
            throw new PropertyException(
                Messages.format( Messages.MUST_BE_STRING, name ) );
    }
View Full Code Here

     * providers may have support for properties on Validator, but the RI doesn't
     */
    public void setProperty( String name, Object value )
        throws PropertyException {
       
        throw new PropertyException(name, value);
    }
View Full Code Here

TOP

Related Classes of javax.xml.bind.PropertyException

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.