Examples of InvalidEntryException


Examples of org.apache.isis.core.metamodel.facets.object.parseable.InvalidEntryException

        return formats;
    }

    @Override
    protected TimeStamp now() {
        throw new InvalidEntryException("Can't change a timestamp.");
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.InvalidEntryException

    public void parseTextEntry(final String entryText) {
        object = parse(entryText);
        Localization localization = IsisContext.getLocalization();
        final String reason = parameter.isValid(object, AdapterUtils.unwrap(object), localization);
        if (reason != null) {
            throw new InvalidEntryException(reason);
        } else if (!parameter.isOptional() && object == null) {
            throw new InvalidEntryException("Mandatory parameter cannot be empty");
        }
        invocation.setParameter(index, object);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.InvalidEntryException

        final ParseableFacet p = parameterSpecification.getFacet(ParseableFacet.class);
        try {
            Localization localization = IsisContext.getLocalization();
            return p.parseTextEntry(object, entryText, localization);
        } catch (final IllegalArgumentException ex) {
            throw new InvalidEntryException(ex.getMessage(), ex);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                {
                    Integer pos = ((Integer)idx.get(name));

                    if (pos == null)
                    {
                        throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
                    }

                    entry = (RegistryEntry)entries.get(pos.intValue()) ;
                }
            }
        }
        catch(Exception e)
        {
            // this will happen if for some reasons the index and vector are desynchronized.
            // before throwing an exception, rebuild the idx to prevent further errors
            synchronized(entries)
            {
                buildIdx();
            }

            logger.error("getEntry: index and vector are not in synch.", e);
            throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
        }

        return entry;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                buildIdx();
            }

            if ( this.idx.containsKey( entry.getName() ) == false )
            {
                throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+entry.getName());
            }

            int pos = ((Integer)idx.get(entry.getName())).intValue();

            this.entries.set( pos, entry );
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                buildIdx();
            }

            if ( this.idx.containsKey( entry.getName() ) )
            {
                throw new InvalidEntryException( InvalidEntryException.ENTRY_ALREADY_PRESENT );
            }

            int pos = this.entries.size();
            this.entries.add( entry );
            this.idx.put( entry.getName(), new Integer(pos) );
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                {
                    Integer pos = ((Integer)idx.get(name));

                    if (pos == null)
                    {
                        throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
                    }

                    entry = (RegistryEntry)entries.get(pos.intValue()) ;
                }
            }
        }
        catch(Exception e)
        {
            // this will happen if for some reasons the index and vector are desynchronized.
            // before throwing an exception, rebuild the idx to prevent further errors
            synchronized(entries)
            {
                buildIdx();
            }

            logger.error("getEntry: index and vector are not in synch.", e);
            throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
        }

        return entry;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                buildIdx();
            }

            if ( this.idx.containsKey( entry.getName() ) == false )
            {
                throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+entry.getName());
            }

            int pos = ((Integer)idx.get(entry.getName())).intValue();

            this.entries.set( pos, entry );
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                buildIdx();
            }

            if ( this.idx.containsKey( entry.getName() ) )
            {
                throw new InvalidEntryException( InvalidEntryException.ENTRY_ALREADY_PRESENT );
            }

            int pos = this.entries.size();
            this.entries.add( entry );
            this.idx.put( entry.getName(), new Integer(pos) );
View Full Code Here

Examples of org.apache.jetspeed.om.registry.InvalidEntryException

                {
                    Integer pos = ((Integer)idx.get(name));

                    if (pos == null)
                    {
                        throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
                    }

                    entry = (RegistryEntry)entries.get(pos.intValue()) ;
                }
            }
        }
        catch(Exception e)
        {
            // this will happen if for some reasons the index and vector are desynchronized.
            // before throwing an exception, rebuild the idx to prevent further errors
            synchronized(entries)
            {
                buildIdx();
            }

            throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
        }

        return entry;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.