Package com.sun.tools.xjc.outline

Examples of com.sun.tools.xjc.outline.ClassOutline


        getPackage().remove(scratch);
    }

    protected List<FieldOutline> findAllDeclaredAndInheritedFields(ClassOutline classOutline) {
        List<FieldOutline> fields = new LinkedList<>();
        ClassOutline currentClassOutline = classOutline;
        while(currentClassOutline != null) {
            fields.addAll(Arrays.asList(currentClassOutline.getDeclaredFields()));
            currentClassOutline = currentClassOutline.getSuperClass();
        }
        return fields;
    }
View Full Code Here


    public String getUsage() {
        return "  -Xdv                 : Initialize fields mapped from elements with their default values";
    }

    private boolean containsDefaultValue(Outline outline, FieldOutline field) {
        ClassOutline fClass = null;
        for (ClassOutline classOutline : outline.getClasses()) {
            if (classOutline.implClass == field.getRawType()) {
                fClass = classOutline;
                break;
            }
        }
        if (fClass == null) {
            return false;
        }
        for (FieldOutline f : fClass.getDeclaredFields()) {
            if (f.getPropertyInfo().getSchemaComponent() instanceof XSParticle) {
                XSParticle particle = (XSParticle)f.getPropertyInfo().getSchemaComponent();
                XSTerm term = particle.getTerm();
                if (term.isElementDecl() && term.asElementDecl().getDefaultValue() != null) {
                    return true;
View Full Code Here

    public String getUsage() {
        return "  -Xdv                 : Initialize fields mapped from elements with their default values";
    }

    private boolean containsDefaultValue(Outline outline, FieldOutline field) {
        ClassOutline fClass = null;
        for (ClassOutline classOutline : outline.getClasses()) {
            if (classOutline.implClass == field.getRawType()) {
                fClass = classOutline;
                break;
            }
        }
        if (fClass == null) {
            return false;
        }
        for (FieldOutline f : fClass.getDeclaredFields()) {
            if (f.getPropertyInfo().getSchemaComponent() instanceof XSParticle) {
                XSParticle particle = (XSParticle)f.getPropertyInfo().getSchemaComponent();
                XSTerm term = particle.getTerm();
                if (term.isElementDecl() && term.asElementDecl().getDefaultValue() != null) {
                    return true;
View Full Code Here

    return true;
  }

  public static Collection<JFieldVar> getSuperclassFields(JCodeModel cm, final ClassOutline classOutline, final boolean collectionsOnly, final boolean checkRequired) {
    final List<JFieldVar> fieldList = new LinkedList<JFieldVar>();
    ClassOutline superclass = classOutline.getSuperClass();
    while (superclass != null) {
      // LOG.info("Retrieving fields for superclass [" + superclass.implClass + "]");
      fieldList.addAll(0, Util.getFields(superclass, collectionsOnly, checkRequired));
      superclass = superclass.getSuperClass();
    }

    // LOG.info("Fields retrieved for superclass of class [" + classOutline.implClass + "] are [" + fieldList + "].");
    for (JFieldVar jFieldVar : fieldList) {
      jFieldVar.type(Util.removeJAXBElement(cm, jFieldVar.type()));
View Full Code Here

    return propertyInfo;
  }

  public static Collection<JFieldVar> getSuperclassAllFields(final ClassOutline classOutline, final boolean collectionsOnly) {
    final List<JFieldVar> fieldList = new LinkedList<JFieldVar>();
    ClassOutline superclass = classOutline.getSuperClass();
    while (superclass != null) {
      // LOG.info("Retrieving fields for superclass [" + superclass.implClass + "]");
      fieldList.addAll(0, getAllFieldsFields(superclass, collectionsOnly));
      superclass = superclass.getSuperClass();
    }

    // LOG.info("Fields retrieved for superclass of class [" + classOutline.implClass + "] are [" + fieldList + "].");

    return fieldList;
View Full Code Here

            final Collection<? extends CTypeInfo> ref = f.getPropertyInfo().ref();

            if ( ref != null && ref.size() == 1 )
            {
                final CTypeInfo refType = ref.iterator().next();
                final ClassOutline refClass =
                    this.getClassOutline( outline, refType.toType( outline, Aspect.EXPOSED ).binaryName() );

                if ( refClass != null )
                {
                    if ( f.getPropertyInfo().isCollection() )
View Full Code Here

    }

    private void annotateMappedSuperclass( final Outline outline, final MappedSuperclass ms )
    {
        final JCodeModel cm = outline.getCodeModel();
        final ClassOutline c = this.getClassOutline( outline, ms.getClazz() );
        c.implClass.annotate( cm.ref( javax.persistence.MappedSuperclass.class ) );

        if ( ms.getAttributes() != null )
        {
            this.annotate( cm, c, ms.getAttributes() );
        }
        if ( ms.getEntityListeners() != null )
        {
            this.annotate( c, ms.getEntityListeners() );
        }
        if ( ms.getExcludeDefaultListeners() != null )
        {
            c.implClass.annotate( c.parent().getCodeModel().ref( javax.persistence.ExcludeDefaultListeners.class ) );
        }
        if ( ms.getExcludeSuperclassListeners() != null )
        {
            c.implClass.annotate( c.parent().getCodeModel().ref( javax.persistence.ExcludeSuperclassListeners.class ) );
        }
        if ( ms.getIdClass() != null )
        {
            this.annotate( c, ms.getIdClass() );
        }
View Full Code Here

    }

    private void annotateEmbeddable( final Outline outline, final Embeddable embeddable )
    {
        final JCodeModel cm = outline.getCodeModel();
        final ClassOutline c = this.getClassOutline( outline, embeddable.getClazz() );
        c.implClass.annotate( cm.ref( javax.persistence.Embeddable.class ) );

        if ( embeddable.getAttributes() != null )
        {
            this.annotate( c, embeddable.getAttributes() );
View Full Code Here

    }

    private void annotateEntity( final Outline outline, final Entity entity )
    {
        final JCodeModel cm = outline.getCodeModel();
        final ClassOutline c = this.getClassOutline( outline, entity.getClazz() );
        final JAnnotationUse a = c.implClass.annotate( cm.ref( javax.persistence.Entity.class ) );

        if ( entity.getName() != null )
        {
            a.param( "name", entity.getName() );
View Full Code Here

    public String getUsage() {
        return "  -Xdv                 : Initialize fields mapped from elements with their default values";
    }

    private boolean containsDefaultValue(Outline outline, FieldOutline field) {
        ClassOutline fClass = null;
        for (ClassOutline classOutline : outline.getClasses()) {
            if (classOutline.implClass == field.getRawType()) {
                fClass = classOutline;
                break;
            }
        }
        if (fClass == null) {
            return false;
        }
        for (FieldOutline f : fClass.getDeclaredFields()) {
            if (f.getPropertyInfo().getSchemaComponent() instanceof XSParticle) {
                XSParticle particle = (XSParticle)f.getPropertyInfo().getSchemaComponent();
                XSTerm term = particle.getTerm();
                if (term.isElementDecl() && term.asElementDecl().getDefaultValue() != null) {
                    return true;
View Full Code Here

TOP

Related Classes of com.sun.tools.xjc.outline.ClassOutline

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.