Examples of ClassDescriptor


Examples of edu.umd.cs.findbugs.classfile.ClassDescriptor

                    List<? extends ReferenceType> parameters = genericMapType.getParameters();
                    if (parameters == null || parameters.size() != 2) {
                        break mapGetCheck;
                    }

                    ClassDescriptor c = DescriptorFactory.getClassDescriptor(genericMapType);
                    if (!Subtypes2.instanceOf(c, Map.class)) {
                        break mapGetCheck;
                    }
                    if (!isStraightGenericMap(c)) {
                        break mapGetCheck;
View Full Code Here

Examples of gap.service.od.ClassDescriptor

            TemplateRenderer template = Templates.GetTemplate(xtm);
            TemplateDataDictionary top = new gap.hapax.AbstractData();
            TemplateDataDictionary servlet;

            for (ClassName servletClassName : servlets){
                ClassDescriptor cd = Classes.ForServlet(servletClassName.getName());
                if (null != cd){
                    servlet = top.addSection(TemplateNames.WebXmlSection);
                    servlet.setVariable(TemplateNames.WebXmlSectionName,cd.getName());
                    servlet.setVariable(TemplateNames.WebXmlSectionClass,servletClassName.getName());
                    servlet.setVariable(TemplateNames.WebXmlSectionUrl,WebXmlPathStar(cd));
                    servlet.setVariable(TemplateNames.WebXmlSectionLoad,"-1");
                }
                else
View Full Code Here

Examples of jodd.introspector.ClassDescriptor

   */
  public void addClassChecks(Class target) {
    List<Check> list = cache.get(target);
    if (list == null) {
      list = new ArrayList<Check>();
      ClassDescriptor cd = ClassIntrospector.lookup(target);
      FieldDescriptor[] fields = cd.getAllFieldDescriptors();
      for (FieldDescriptor fieldDescriptor : fields) {
        collectFieldAnnotationChecks(list, fieldDescriptor.getField());
      }
      cache.put(target, list);
    }
View Full Code Here

Examples of net.sourceforge.javautil.common.reflection.cache.ClassDescriptor

   * @return The response
   */
  protected void accept (ObjectVisitorBase visitor, ObjectVisitorContext ctx) {
    visitor.visit(ctx);
    if (ctx.isContinue()) {
      ClassDescriptor descriptor = ClassCache.getFor(instance.getClass());
      Map<String, ClassProperty> properties = descriptor.getProperties();
      for (String name : properties.keySet()) {
        ClassProperty op = properties.get(name);
        Object value = op.getValue(instance);
       
        if (value == null) continue;
View Full Code Here

Examples of net.sourceforge.javautil.common.reflection.cache.ClassDescriptor

   * @param propertyNames The names of the properties to copy from the source to the target
   */
  public static void setProperties (Object target, Object source, String... propertyNames) {
    assert target != null && source != null : "Objects cannot be null";
   
    ClassDescriptor descT = ClassCache.getFor(target.getClass());
    ClassDescriptor descS = ClassCache.getFor(source.getClass());
   
    if (propertyNames.length == 0) {
      Map<String,ClassProperty> props = descS.getProperties();
      propertyNames = props.keySet().toArray(new String[props.size()]);
    }
   
    for (String propertyName : propertyNames) {
      descT.setPropertyValue(target, propertyName, descS.getPropertyValue(source, propertyName));
    }
  }
View Full Code Here

Examples of oracle.toplink.essentials.descriptors.ClassDescriptor

     */
    public void addToCollectionChangeRecord(Object newKey, Object newValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) {
        if (newValue == null) {
            newValue = DirectCollectionChangeRecord.Null;
        }
        ClassDescriptor descriptor;
        DirectCollectionChangeRecord collectionChangeRecord = (DirectCollectionChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName());
        if (collectionChangeRecord == null) {
            collectionChangeRecord = new DirectCollectionChangeRecord(objectChangeSet);
            collectionChangeRecord.setAttribute(getAttributeName());
            collectionChangeRecord.setMapping(this);
View Full Code Here

Examples of org.apache.cayenne.property.ClassDescriptor

        if (id == null) {
            throw new IllegalArgumentException("Null ObjectId");
        }

        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent cachedObject = (Persistent) getGraphManager().getNode(id);

        // merge into an existing object
        if (cachedObject != null) {

            // TODO: Andrus, 1/24/2006 implement smart merge for modified objects...
            if (cachedObject != prototype
                    && cachedObject.getPersistenceState() != PersistenceState.MODIFIED
                    && cachedObject.getPersistenceState() != PersistenceState.DELETED) {

                descriptor.injectValueHolders(cachedObject);
                if (prototype != null
                        && prototype.getPersistenceState() != PersistenceState.HOLLOW) {

                    descriptor.shallowMerge(prototype, cachedObject);

                    if (cachedObject.getPersistenceState() == PersistenceState.HOLLOW) {
                        cachedObject.setPersistenceState(PersistenceState.COMMITTED);
                    }
                }
            }

            return cachedObject;
        }
        // create and merge into a new object
        else {

            // Andrus, 1/26/2006 - note that there is a tricky case of a temporary object
            // passed from peer DataContext... In the past we used to throw an exception
            // or return null. Now that we can have a valid (but generally
            // indistinguishible) case of such object passed from parent, we let it
            // slip... Not sure what's the best way of handling it that does not involve
            // breaking encapsulation of the DataChannel to detect where in the hierarchy
            // this context is.

            Persistent localObject = (Persistent) descriptor.createObject();

            localObject.setObjectContext(this);
            localObject.setObjectId(id);

            getGraphManager().registerNode(id, localObject);

            if (prototype != null) {
                localObject.setPersistenceState(PersistenceState.COMMITTED);
                descriptor.injectValueHolders(localObject);
                descriptor.shallowMerge(prototype, localObject);
            }
            else {
                localObject.setPersistenceState(PersistenceState.HOLLOW);
            }
View Full Code Here

Examples of org.apache.cayenne.property.ClassDescriptor

    }

    // ****** non-public methods ******

    Persistent createNewObject(ObjectId id) {
        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent object = (Persistent) descriptor.createObject();

        object.setPersistenceState(PersistenceState.NEW);
        object.setObjectContext(this);
        object.setObjectId(id);

        descriptor.injectValueHolders(object);
        graphManager.registerNode(object.getObjectId(), object);
        graphManager.nodeCreated(object.getObjectId());

        return object;
    }
View Full Code Here

Examples of org.apache.cayenne.property.ClassDescriptor

        return object;
    }

    Persistent createFault(ObjectId id) {
        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent object = (Persistent) descriptor.createObject();

        object.setPersistenceState(PersistenceState.HOLLOW);
        object.setObjectContext(this);
        object.setObjectId(id);

        // note that this must be called AFTER setting persistence state, otherwise we'd
        // get ValueHolders incorrectly marked as resolved
        descriptor.injectValueHolders(object);

        graphManager.registerNode(id, object);

        return object;
    }
View Full Code Here

Examples of org.apache.cayenne.reflect.ClassDescriptor

        if (entity == null) {
            throw new CayenneRuntimeException("No entity mapped for class: "
                    + persistentClass);
        }

        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                entity.getName());
        T object = (T) descriptor.createObject();
        registerNewObject((Persistent) object, entity.getName(), descriptor);
        return object;
    }
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.