Package org.infoset.xml

Examples of org.infoset.xml.XMLException


                           realm = db.createRealm(name,id);
                        }
                     } catch (IllegalArgumentException ex) {
                        log.warning("Bad UUID value '"+sid+"' on realm.");
                     } catch (SQLException ex) {
                        throw new XMLException("Database error on realm "+sid,ex);
                     }
                  }
               break;
               case ElementEndItem:
                  realm = null;
View Full Code Here


                        id = null;
                        name = null;
                        email = null;
                        alias = null;
                     } catch (SQLException ex) {
                        throw new XMLException("Database error while creating realm user ("+alias+","+id+")",ex);
                     }
                  }
            }
         } else if (level==6) {
            switch (item.getType()) {
View Full Code Here

                           group = db.createGroup(realm,id,alias);
                        } else {
                           log.info("Group ("+alias+","+id+") already exists.");
                        }
                     } catch (SQLException ex) {
                        throw new XMLException("Database error while creating group ("+alias+","+sid+")",ex);
                     } catch (IllegalArgumentException ex) {
                        log.warning("Bad UUID value '"+sid+"' on group.");
                     }
                  }
               break;
View Full Code Here

                  } else {
                     log.info("Adding role ("+role.getName()+","+role.getUUID()+")");
                     group.addRole(role);
                  }
               } catch (SQLException ex) {
                  throw new XMLException("Database error while adding role "+sid+" to group ("+group.getAlias()+","+group.getUUID()+").",ex);
               } catch (IllegalArgumentException ex) {
                  log.warning("Bad UUID value '"+sid+"' on role in group ("+group.getAlias()+","+group.getUUID()+").");
               }
            }
         }
View Full Code Here

                        }
                     }
                  } catch (IllegalArgumentException ex) {
                     log.warning("Bad UUID value '"+sid+"' on permission.");
                  } catch (SQLException ex) {
                     throw new XMLException("Database error creating permission "+sid,ex);
                  }
               }
            }
         }
      }
View Full Code Here

            level++;
            Element e = (Element)item;
            switch (level) {
               case 1:
                  if (!e.getName().equals(XML.FEED_NAME)) {
                     throw new XMLException("Feed does not start with an Atom 'feed' element: "+e.getName(),(Location)e);
                  }
                  docDest = new DocumentDestination();
                  //System.out.println("Feed: "+e.isBaseURIInherited()+", "+e.getBaseURI());
                  docDest.send(e.getInfoset().createItemConstructor().createDocument(e.getBaseURI()));
                  docDest.send(e);
                  break;
               case 2:
                  if (!feedSent) {
                     if (e.getName().equals(XML.ENTRY_NAME)) {
                        // send the feed document
                        this.onFeed(docDest.getDocument());
                        feedSent = true;
                        // Now collect the first entry
                        //System.out.println("Entry: "+e.isBaseURIInherited()+", "+e.getBaseURI());
                        docDest = new DocumentDestination();
                        docDest.send(e.getInfoset().createItemConstructor().createDocument(e.getBaseURI()));
                        e.localizeNamespaceDeclarations();
                        docDest.send(e);
                     } else {
                        docDest.send(e);
                     }
                  } else {
                     if (!e.getName().equals(XML.ENTRY_NAME)) {
                        throw new XMLException("Non-entry element after the first entry: "+e.getName(),(Location)e);
                     }
                    
                     // collect the entry
                     //System.out.println("Entry: "+e.isBaseURIInherited()+", "+e.getBaseURI());
                     docDest = new DocumentDestination();
View Full Code Here

               loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
              
            }
         }
      } catch (Exception ex) {
         throw new XMLException("Exception while getting ancestors.",ex);
      }
      dest.send(constructor.createCharacters("\n"));
      dest.send(constructor.createElementEnd(AtomResource.FEED_NAME));
      dest.send(constructor.createDocumentEnd());
   }
View Full Code Here

            dest.send(constructor.createCharacters(value.toString()));
         }

         dest.send(constructor.createElementEnd(AtomResource.CATEGORY_NAME));
      } catch (UnsupportedEncodingException ex) {
         throw new XMLException("Cannot decode term "+parts[1],ex);
      }
   }
View Full Code Here

   {
      if (xml==null) {
         try {
            parse();
         } catch (IOException ex) {
            throw new XMLException("Cannot load XML due to I/O exception.",ex);
         }
      }
      try {
         Element top = getElement();
         name = top.getAttributeValue("name");
         String intro = top.getAttributeValue("introspect");
         introspect = intro==null ? null : URI.create(intro);
         root = URI.create(top.getAttributeValue("root"));
         Element authE = top.getFirstElementNamed(AdminXML.NM_AUTH);
         auth = authE==null ? null : new AuthCredentials(authE.getAttributeValue("method"),authE.getAttributeValue("name"),authE.getAttributeValue("password"));
      } catch (Exception ex) {
         throw new XMLException("Cannot unmarshall XML: "+ex.getMessage(),ex);
      }
   }
View Full Code Here

         Element appE = appElements.next();
         String appName = appE.getAttributeValue("name");
         String match = appE.getAttributeValue("match");
         AppDef def = appDefs.get(appName);
         if (def==null) {
            throw new XMLException("Cannot find defintion of application "+appName);
         }
         AppConf appconf = new AppConf(def,match,(Element)appE.copyOfItem(true),host.getLinks());

         Iterator<Element> appLinks = appE.getElementsByName(LINK);
         while (appLinks.hasNext()) {
View Full Code Here

TOP

Related Classes of org.infoset.xml.XMLException

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.