Examples of CPluginCustomization


Examples of com.sun.tools.xjc.model.CPluginCustomization

        {
            boolean mapped = false;

            if ( f.getPropertyInfo().getCustomizations().find( ORM_NS, "basic" ) != null )
            {
                final CPluginCustomization pc = f.getPropertyInfo().getCustomizations().find( ORM_NS, "basic" );
                final Basic basic = JAXB.unmarshal( new DOMSource( pc.element ), Basic.class );

                if ( basic.getName() == null )
                {
                    basic.setName( f.getPropertyInfo().getName( false ) );
                }

                attributes.getBasic().add( basic );
                mapped = true;

                if ( !pc.isAcknowledged() )
                {
                    pc.markAsAcknowledged();
                }
            }

            if ( f.getPropertyInfo().getCustomizations().find( ORM_NS, "transient" ) != null )
            {
                final CPluginCustomization pc = f.getPropertyInfo().getCustomizations().find( ORM_NS, "transient" );
                final Transient t = JAXB.unmarshal( new DOMSource( pc.element ), Transient.class );

                if ( t.getName() == null )
                {
                    t.setName( f.getPropertyInfo().getName( false ) );
                }

                attributes.getTransient().add( t );
                mapped = true;

                if ( !pc.isAcknowledged() )
                {
                    pc.markAsAcknowledged();
                }
            }

            if ( !mapped )
            {
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

    }

    public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {
      
        for (ClassOutline co : outline.getClasses()) {
            CPluginCustomization cust = co.target.getCustomizations().find(CFG_NAMESPACE_URI,
                                                                           CFG_CONFIGURABLE_ELEM_NAME);
            if (null == cust) {
                continue;
            }

            cust.markAsAcknowledged();

            // generated class extends AbstractConfigurableBeanBase

            JDefinedClass dc = co.implClass;
            dc._extends(AbstractConfigurableBeanBase.class);
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

    }

    // meat of the processing
    public boolean run(Outline model, Options opt, ErrorHandler errorHandler) {
        for( ClassOutline co : model.getClasses() ) {
            CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code");
            if(c==null)
                continue;   // no customization --- nothing to inject here

            c.markAsAcknowledged();
            // TODO: ideally you should validate this DOM element to make sure
            // that there's no typo/etc. JAXP 1.3 can do this very easily.
            String codeFragment = DOMUtils.getElementText(c.element);

            // inject the specified code fragment into the implementation class.
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

        for( Element e : DOMUtil.getChildElements(dom) ) {
            if(!model.options.pluginURIs.contains(e.getNamespaceURI()))
                continue;   // this isn't a plugin customization
            if(r==null)
                r = new CCustomizations();
            r.add(new CPluginCustomization(e, DOMLocator.getLocationInfo(e)));
        }

        if(r==null)     r = CCustomizations.EMPTY;
        return new CCustomizations(r);
    }
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

                pc.markAsAcknowledged();
                if(!Ring.get(Model.class).options.pluginURIs.contains(pc.getName().getNamespaceURI()))
                    continue;   // this isn't a plugin customization
                if(r==null)
                    r = new CCustomizations();
                r.add(new CPluginCustomization(pc.element,pc.getLocation()));
            }
        }

        if(r==null)     r = CCustomizations.EMPTY;
        return new CCustomizations(r);
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

  /**
   * Clone given configuration and apply settings from global/class/field JAXB customization.
   */
  private Configuration applyConfigurationFromCustomizations(Configuration configuration,
              CCustomizations customizations) throws IOException, ClassNotFoundException {
    CPluginCustomization customization = customizations.find(XEW_QNAME.getNamespaceURI(), XEW_QNAME.getLocalPart());

    if (customization != null) {
      configuration = configuration.clone();

      customization.markAsAcknowledged();

      NamedNodeMap attributes = customization.element.getAttributes();
      Map<String, String> options = new HashMap<String, String>();

      for (int i = 0; i < attributes.getLength(); i++) {
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

                pc.markAsAcknowledged();
                if(!Ring.get(Model.class).options.pluginURIs.contains(pc.getName().getNamespaceURI()))
                    continue;   // this isn't a plugin customization
                if(r==null)
                    r = new CCustomizations();
                r.add(new CPluginCustomization(pc.element,pc.getLocation()));
            }
        }

        if(r==null)     r = CCustomizations.EMPTY;
        return new CCustomizations(r);
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

                pc.markAsAcknowledged();
                if(!Ring.get(Model.class).options.pluginURIs.contains(pc.getName().getNamespaceURI()))
                    continue;   // this isn't a plugin customization
                if(r==null)
                    r = new CCustomizations();
                r.add(new CPluginCustomization(pc.element,pc.getLocation()));
            }
        }

        if(r==null)     r = CCustomizations.EMPTY;
        return new CCustomizations(r);
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

        for( Element e : DOMUtil.getChildElements(dom) ) {
            if(!model.options.pluginURIs.contains(e.getNamespaceURI()))
                continue;   // this isn't a plugin customization
            if(r==null)
                r = new CCustomizations();
            r.add(new CPluginCustomization(e, DOMLocator.getLocationInfo(e)));
        }

        if(r==null)     r = CCustomizations.EMPTY;
        return new CCustomizations(r);
    }
View Full Code Here

Examples of com.sun.tools.xjc.model.CPluginCustomization

    }

    // meat of the processing
    public boolean run(Outline model, Options opt, ErrorHandler errorHandler) {
        for( ClassOutline co : model.getClasses() ) {
            CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code");
            if(c==null)
                continue;   // no customization --- nothing to inject here

            c.markAsAcknowledged();
            // TODO: ideally you should validate this DOM element to make sure
            // that there's no typo/etc. JAXP 1.3 can do this very easily.
            String codeFragment = DOMUtils.getElementText(c.element);

            // inject the specified code fragment into the implementation class.
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.