Exemple #1
0
 public ClassNode postCopy() {
   _metaclassNode =
       MetaclassNode.factory.classNode_methods_instVars_sharedVariables_traitUsage_(
           this,
           _metaclassNode.methods(),
           _metaclassNode.instVars(),
           _metaclassNode.sharedVariables(),
           _metaclassNode.traitUsage());
   return this;
 }
Exemple #2
0
 @Override
 public SourceFile findSourceFile() {
   if (_sourcePosition != null) {
     return _sourcePosition.sourceFile();
   }
   if (_metaclassNode.sourcePosition() == null) {
     return null;
   }
   return _metaclassNode.sourcePosition().sourceFile();
 }
Exemple #3
0
 public ClassNode pvtSetMetaclassNode_(final MetaclassNode _aMetaclassNode) {
   if (_metaclassNode == _aMetaclassNode) {
     return ClassNode.this;
   }
   _metaclassNode = _aMetaclassNode.pvtWithClassNode_(this);
   return this;
 }
Exemple #4
0
 public UpdateClassDiff diffTo_(final ClassNode _aClassNode) {
   if (!st.gravel.support.jvm.ObjectExtensions.equals_(_aClassNode.name(), _name)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.ArrayExtensions.equals_(_aClassNode.namespace(), _namespace)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.StringExtensions.equals_(
       _aClassNode.superclassPath(), _superclassPath)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.DictionaryExtensions.equals_(
       _aClassNode.properties(), _properties)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.BooleanExtensions.equals_(_aClassNode.isExtension(), _isExtension)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.BooleanExtensions.equals_(_aClassNode.isTrait(), _isTrait)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   return UpdateClassDiff.factory.reference_superclassReference_thisDiff_metaDiff_(
       _aClassNode.reference(),
       ((AbsoluteReference) _aClassNode.superclassReference()),
       this.diffToClassDescriptionNode_(_aClassNode),
       _metaclassNode.diffToClassDescriptionNode_(_aClassNode.metaclassNode()));
 }
Exemple #5
0
 @Override
 public ClassNode flattenTraitsIn_(final SystemNode _aSystemNode) {
   final MetaclassNode _newMetaclassNode;
   final ClassNode _newClassNode;
   _newMetaclassNode = _metaclassNode.flattenTraitsIn_(_aSystemNode);
   _newClassNode = _traitUsage.flattenClassNode_in_(this, _aSystemNode);
   if ((_newClassNode == this) && (_newMetaclassNode == _metaclassNode)) {
     return ClassNode.this;
   }
   return _newClassNode.copy().pvtSetMetaclassNode_(_newMetaclassNode);
 }
Exemple #6
0
 public ClassNode withSharedVariable_(final SharedDeclarationNode _aSharedDeclarationNode) {
   return this.copy()
       .pvtSetMetaclassNode_(_metaclassNode.withSharedVariable_(_aSharedDeclarationNode));
 }
Exemple #7
0
 public ClassNode withClassTrait_(final TraitUsageNode _aTraitUsageNode) {
   return this.copy().pvtSetMetaclassNode_(_metaclassNode.withTrait_(_aTraitUsageNode));
 }
Exemple #8
0
 public ClassNode withClassMethodNode_(final MethodNode _aMethodNode) {
   return this.copy().pvtSetMetaclassNode_(_metaclassNode.withMethodNode_(_aMethodNode));
 }
Exemple #9
0
 public ClassNode withClassInstVar_(final VariableDeclarationNode _aVariableDeclarationNode) {
   return this.copy().pvtSetMetaclassNode_(_metaclassNode.withInstVar_(_aVariableDeclarationNode));
 }
Exemple #10
0
 public ClassNode pvtSetClassMethods_(final MethodNode[] _anArray) {
   return this.pvtSetMetaclassNode_(_metaclassNode.withMethods_(_anArray));
 }
Exemple #11
0
 public TraitUsageNode classTraitUsage() {
   return _metaclassNode.traitUsage();
 }
Exemple #12
0
 public MethodNode[] classMethods() {
   return _metaclassNode.methods();
 }