Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSModel


     * @see de.mindcrimeilab.xsanalyzer.Analyzer#analyze(de.mindcrimeilab.xsanalyzer.model.XsAnalyzerApplicationModel)
     */
    @Override
    public void analyze(final XsAnalyzerApplicationModel model) {
        setup(model);
        final XSModel xsmodel = model.getSchemaModel();
        XsModelWalker walker = new XsModelWalker();
        walker.addPropertyChangeListener(getProgessListener());
        walker.addWorker(unusedTypeFinder);
        walker.addWorker(typeUsageFinder);
        walker.walkModel(xsmodel);
View Full Code Here


        this.setResult(model);
    }

    @Override
    public void setup(final XsAnalyzerApplicationModel model) {
        XSModel xsmodel = model.getSchemaModel();
        final XSNamespaceItemList nsList = xsmodel.getNamespaceItems();
        final List<XSNamespaceItem> namespaceItems = new LinkedList<XSNamespaceItem>();

        for (int i = 0; i < nsList.getLength(); ++i) {
            XSNamespaceItem item = nsList.item(i);
            namespaceItems.add(item);
View Full Code Here

        VisualProgressWorker<Collection<Analyzer>, Void> worker = new VisualProgressWorker<Collection<Analyzer>, Void>(this.getParentWindow()) {

            @Override
            protected Collection<Analyzer> doInBackground() throws Exception {
                XSModel xsmodel = model.getSchemaModel();

                final XsModelWalker walker = new XsModelWalker();

                final PropertyChangeListener changeListener = new PropertyChangeListener() {
View Full Code Here

      String typeName = xmlType.getLocalPart();

      try
      {
         // Get the parsed model
         XSModel model = jaxrpcContext.getXsModel();

         // Get the jaxrpc-mapping.xml meta data
         JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();

         unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
View Full Code Here

      SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;

      try
      {
         // Get the parsed model
         XSModel model = jaxrpcContext.getXsModel();

         // Get the jaxrpc-mapping.xml object graph
         JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();

         // schemabinding marshaller is the default delegate
View Full Code Here

    */
   public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
   {
      if (xsdLocation == null)
         throw new IllegalArgumentException("xsdLocation is null");
      XSModel xsmodel = parseSchema(xsdLocation);
      return this.hasComplexTypeDefinition(xmlType, xsmodel);
   }
View Full Code Here

   {
      if (xmlName == null)
         throw new IllegalArgumentException("xmlName is null");
      if (xsdLocation == null)
         throw new IllegalArgumentException("xsdLocation is null");
      XSModel xsmodel = parseSchema(xsdLocation);
      boolean bool = false;
      String name = xmlName.getLocalPart();
      if (name == null)
         throw new IllegalArgumentException("xmlName has a null name");
      String ns = xmlName.getNamespaceURI();
      if (ns == null)
         throw new IllegalArgumentException("xmlName has a null namespace");
      if (xsmodel.getElementDeclaration(name, ns) != null)
         bool = true;
      return bool;
   }
View Full Code Here

    * @return schema model
    */
   public XSModel parseSchema(String schemaLoc)
   {
      XSLoader xsloader = getXSLoader();
      XSModel xsModel = xsloader.loadURI(schemaLoc);
      if (xsModel == null)
         throw new WSException("Cannot parse schema: " + schemaLoc);
      return xsModel;
   }
View Full Code Here

      /**
       * Builds the anonymous type mapping. This is intended to be called lazily.
       */
      public void build()
      {
         XSModel model = JBossXSModel.this;

         anonymousTypeMap = new HashMap<String, XSTypeDefinition>();

         anonymousElementMap = new HashMap<String, XSElementDeclaration>();

        
         processed.clear();
        
         XSNamedMap namedMap = model.getComponents(XSConstants.TYPE_DEFINITION);
         for (int i = 0; i < namedMap.getLength(); i++)
         {
            XSTypeDefinition type = (XSTypeDefinition)namedMap.item(i);
            if (type.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE)
               continue;

            analyzeComplexType((XSComplexTypeDefinition)type, null, type.getNamespace());
         }

         namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
         for (int i = 0; i < namedMap.getLength(); i++)
         {
            XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
            analyzeElement(element, null, element.getNamespace(), null, null);
         }
View Full Code Here

            // set validation feature
            config.setParameter("validate", Boolean.TRUE);

            // parse document
            System.out.println("Parsing " + argv[0] + "...");
            XSModel model = schemaLoader.loadURI(argv[0]);
            if (model != null) {
              // element declarations
                XSNamedMap map = model.getComponents(XSConstants.ELEMENT_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global element declarations: {namespace} name ");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
                // attribute declarations
                map = model.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
                    System.out.println("* Global attribute declarations: {namespace} name");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
        // notation declarations
        map = model.getComponents(XSConstants.TYPE_DEFINITION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global type declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
            XSObject item = map.item(i);
            System.out.println("{" + item.getNamespace() + "}" + item.getName());
          }
        }
               
        // notation declarations
        map = model.getComponents(XSConstants.NOTATION_DECLARATION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global notation declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSModel

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.